I can't get the DIALOG SET LOC to work as I expect. The following short
program illustrates the problem I'm having. The idea is to move a child
window to a location relative to its parent. In the following program, a
child window should move to a position 10,10 units relative to its parent,
hDlg, but instead, moves it to a position 10,10 relative to the screen.
I've read and reread the user's manual, but I can't figure it out.
Please, someone, help.
------------------
[This message has been edited by Charles Dietz (edited October 17, 2001).]
program illustrates the problem I'm having. The idea is to move a child
window to a location relative to its parent. In the following program, a
child window should move to a position 10,10 units relative to its parent,
hDlg, but instead, moves it to a position 10,10 relative to the screen.
I've read and reread the user's manual, but I can't figure it out.
Please, someone, help.
Code:
#COMPILE EXE #DEBUG ERROR ON #DIM ALL #INCLUDE "win32api.inc" GLOBAL style AS LONG DECLARE CALLBACK FUNCTION dlgProc() DECLARE CALLBACK FUNCTION childDlgProc() DECLARE SUB childWindow FUNCTION PBMAIN GLOBAL hDlg AS LONG style=%WS_SYSMENU + %WS_MINIMIZEBOX DIALOG NEW 0,"Problem with moving windows",,,250,200,style TO hDlg CONTROL ADD BUTTON, hDlg, 100, "Child", 100, 100, 60, 30 DIALOG SHOW MODAL hDlg CALL dlgProc END FUNCTION CALLBACK FUNCTION dlgProc() SELECT CASE CBMSG CASE %WM_COMMAND IF CBCTL = 100 THEN childWindow END IF END SELECT END FUNCTION SUB childWindow LOCAL hChildDlg AS LONG DIALOG NEW hDlg,"Window to move",0,0,150,100,style TO hChildDlg CONTROL ADD BUTTON, hChildDlg, 200, "Move", 40, 40, 60, 30 DIALOG SHOW MODAL hChildDlg CALL childDlgProc END SUB CALLBACK FUNCTION childDlgProc() SELECT CASE CBMSG CASE %WM_COMMAND IF CBCTL = 200 THEN DIALOG SET LOC CBHNDL, 10, 10 END IF END SELECT END FUNCTION
------------------
[This message has been edited by Charles Dietz (edited October 17, 2001).]
Comment