Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Menu/Toolbar dlg in exe
#1
Hi All,
I created this to add Menu/Toolbar dlg in exe. It works pretty well but I am sure Gintaras could class it up!! Big Grin

Function TestExeDlgMenu
Code:
Copy      Help
\Dialog_Editor

function# hDlg message wParam lParam
if(hDlg) goto messages

CloseWindowsOf("DlgMenu" "#32770");err
run "$system$\notepad.exe" "" "" "" 0x1800 win("Notepad" "Notepad")
if(!ShowDialog("TestExeDlgMenu" &TestExeDlgMenu 0)) ret

;BEGIN DIALOG
;0 "" 0x80000840 0x90 0 0 385 11 "DlgMenu"
;3 Button 0x54032000 0x0 0 0 48 11 "Button1"
;4 Button 0x54032000 0x0 48 0 48 11 "Button2"
;5 Button 0x54032000 0x0 96 0 48 11 "Button3"
;6 Button 0x54032000 0x0 144 0 48 11 "Button4"
;7 Button 0x54032000 0x0 192 0 48 11 "Button5"
;8 Button 0x54032000 0x0 240 0 48 11 "Button6"
;9 Button 0x54032000 0x0 288 0 48 11 "Button7"
;10 Button 0x54032000 0x0 336 0 48 11 "Button8"
;1 Button 0x54030001 0x4 64 402 48 11 "OK"
;2 Button 0x54030000 0x4 118 402 48 11 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030502 "*" "" "" ""




ret
;messages
sel message
,case WM_INITDIALOG
,__GdiHandle-- hb=CreateSolidBrush(0xff00)
,Transparent hDlg 255 0xff00
,int+ NotePadHwnd = win("Notepad" "Notepad")
,SetWindowLong hDlg GWL_HWNDPARENT NotePadHwnd
,SetTimer hDlg 1 100 0
,;SendMessage hDlg WM_COMMAND 5 0 ;;execute gButton code. Or use function instead.
,SendMessage hDlg WM_TIMER 1 0 ;;execute gTimer code. Or use function instead.    
,case WM_TIMER
,sel wParam
,,case 1 goto gTimer    
,case WM_DESTROY    
,case WM_CTLCOLORDLG ret hb
,case WM_COMMAND goto messages2
,
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1

;gButton
ret

;gTimer
Zorder hDlg HWND_TOP SWP_NOACTIVATE
int x_NotePad y_NotePad cx_NotePad cy_NotePad;
ifi(NotePadHwnd)    
,GetWinXY NotePadHwnd x_NotePad y_NotePad cx_NotePad cy_NotePad
else
,CloseWindowsOf("DlgMenu" "#32770");err
,ret
int x_Dlg y_Dlg cx_Dlg cy_Dlg
GetWinXY hDlg x_Dlg y_Dlg cx_Dlg cy_Dlg
MoveWindow hDlg x_NotePad+25 y_NotePad+3 cx_NotePad-100 cy_Dlg  1;;need to leave enough room for max/min/close app dlg frame buttons and enough of frame to grab for moving/resizing


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)