Skip to main content

Posts

Showing posts from March, 2009

Bring MFC dialog window to Top of all Windows

Hello Folks !!!! Lately i was developing a Windows CE Auto Version check application and i need to warn User before i trigger OS upgrade so Auto close warning dialog is expected to be top-most window. Following code does the magic. All you need to do is, place this code in OnInitDialog or whereever you want. CWnd* MainWnd= AfxGetMainWnd();   MainWnd->SetWindowPos (&MainWnd->wndTopMost ,0,0,0,0, SWP_NOMOVE| SWP_NOSIZE| SWP_SHOWWINDOW); Thats it!!!!!!! Not a big deal :)

What is the Current Directory in Windows CE & Windows Mobile ?

Lately i encountered  a situation where i had to find the current directory from where my application is running and all my config files reside. Question is "How do I find the current directory?" on Windows CE/Mobile devices. Desktop / PC it is just piece of cake but Windows CE / Mobile devices don't have a concept of a current directory.  Which means all pats are absolute and there is no concept called relative path. Due to lack of relative paths most of the files are loaded to the "Windows" directory and that is how Windows directory is crowded. Alternatively you can hard code directory path and insist user to load files always there. But i hate to hard code values or copy files to Windows directory.  So this has triggered to find a solution to identify my current directory. Since there is no concept of a current directory on a Windows CE / Windows Mobile device how would one locate a resource for which only a relative path is known?  That is what following c