Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moveable one dialog window

Status
Not open for further replies.

xwb

Programmer
Jul 11, 2002
6,828
GB
I've got a program that looks like
Code:
#include "stdafx.h"
#include "resource.h"
#include "CommentDlg.h"

int APIENTRY WinMain(
   HINSTANCE hInstance,
   HINSTANCE hPrevInstance,
   LPSTR     lpCmdLine,
   int       nCmdShow)
{  
    DialogBox(hInstance, MAKEINTRESOURCE(IDD_COMMENTDLG), 0, (DLGPROC)CommentDlg);
    return 0;
}
CommentDlg is just a switch statement - basically a WinProc. On XP VS2003, it just stays in the top left corner and cannot be moved. On Vista VS2005, I can move it round. I don't have VS2005 on XP.

I'm just wondering: is this an XP problem or a VS2003 problem. If it is a VS2003 problem then I'll have to uninstall VS2003 and find a copy of VS2005 somewhere that I can install.
 
Just copied the VS2005 executable to XP and the VS2003 executable to Vista. Can't move the window round on XP but I can on Vista so I guess it is an XP problem.

Any idea how I can get around this problem short of rewriting the WinMain bit? On XP, it doesn't pick up WM_WINPOSCHANGING with any coordinate other than 0,0. On Vista, I get the value of the top left corner. Do I need to set some special property first?
 
What is even more curious is it doesn't work at all on W2K. Works fine on W95/W98.
 
The W2K thing is a red herring - it was the ICC stuff. It is stills stuck in the top left corner.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top