|
-
July 26th, 2010, 10:05 AM
#1
[RESOLVED] No Move Dialog
Hello to all
I am trying to make a No-Move dialog.
This is my code:
Code:
hWndDlg= CreateDialog(hInstance, MAKEINTRESOURCE(IDD_CREAREQ), hWnd, (DLGPROC) DlgCreaReqProc) ;
ShowWindow(hWndDlg, SW_SHOW);
UpdateWindow(hWndDlg);
SetWindowPos(hWndDlg, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
The dialog keep on moving when I drag it with mouse!
Someone can help me?
Thank you!
-
July 26th, 2010, 10:18 AM
#2
Re: No Move Dialog
Victor Nijegorodov
-
July 26th, 2010, 10:59 AM
#3
Re: No Move Dialog
SetWindowPos(hWndDlg, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
Nice joke, man.
FYI, SWP_NOMOVE means here: this SetWindowPos call is not intended for moving this window, so all position parameters must be ignored. All what this call does is it changes the window Z-order. It does not put any restrictions on windows abilities to move and re-size.
Last edited by Igor Vartanov; July 26th, 2010 at 03:23 PM.
Best regards,
Igor
-
July 27th, 2010, 06:38 AM
#4
Re: No Move Dialog
Ok, ok
Thanks to all of you for your precious help.
I solved the situation by the following way:
Code:
int CALLBACK DlgProc(......)
switch (message) {
.....
.....
case WM_NCHITTEST :
return HTCLIENT ;
break ;
.......
}
By this way, the mouse appears to be into the dialog even if the mouse is put on the title bar.
Thank you very much!!
-
July 27th, 2010, 07:04 AM
#5
Re: No Move Dialog
 Originally Posted by motobizio
I solved the situation by the following way:
Code:
int CALLBACK DlgProc(......)
switch (message) {
.....
.....
case WM_NCHITTEST :
return HTCLIENT ;
break ;
.......
}
No, you failed to solve it! 
Your window can be moved using sys menu "move" + either mouse or any arrow key.
Please, check out this thread.
Victor Nijegorodov
-
July 27th, 2010, 07:53 AM
#6
Re: No Move Dialog
 Originally Posted by VictorN
No, you failed to solve it! 
Your window can be moved using sys menu "move" + either mouse or any arrow key.
Please, check out this thread.
You are right. I forgot to say that, in WM_INITDIALOG, I disabled SYSMENU.
Thank you !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|