Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
External App Dialog Frame with Splitters
#1
Hi Gintaras,
Rather than hanging QM dialogs/toolbars/menu's on other apps, I wanted to encase several external apps within a dialog frame with relevant buttons and easy resizing with QM splitter functions. I have something here that works but I am worried about the resource use of the rep loop function and wondering what else I could do to make it better. Don't worry about the loading of the external apps or any wintesting on them, those are just examples. I am more interested in the mechanism for maintaining them properly in their frame and handling Zorder well.
Thanks for any ideas,
S

Function dlg_ExternalAppSplitter
Code:
Copy      Help
\Dialog_Editor

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

str controls = "3 4 5 7"
str e3 e4 c5Not c7Pai
if(!ShowDialog("dlg_ExternalAppSplitter" &dlg_ExternalAppSplitter &controls)) ret

;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 227 265 "App Frame"
;3 Edit 0x54231044 0x200 4 16 220 101 ""
;4 Edit 0x54231044 0x200 4 126 222 101 ""
;1 Button 0x54030001 0x4 62 248 48 14 "OK"
;2 Button 0x54030000 0x4 120 248 48 14 "Cancel"
;6 QM_Splitter 0x54000000 0x0 4 118 220 8 ""
;9 QM_Splitter 0x54000000 0x0 4 228 222 2 ""
;5 Button 0x54031003 0x0 44 0 48 14 "Notepad"
;7 Button 0x54031003 0x0 92 0 48 14 "Paint"
;END DIALOG
;DIALOG EDITOR: "" 0x2030408 "*" "" "" ""


;;;;;Action - m (move) or s (resize).
;;;;;Direction - h (horizontally) or v (vertically) or none (horizontally and vertically).



ret
;messages
DT_AutoSizeControls hDlg message "3s 4s 6m"
DlgSplitter ds1.Init(hDlg 6)
DlgSplitter ds2.Init(hDlg 9)
sel message
,case WM_INITDIALOG
,,ifi-(win("Paint" "MSPaintApp"))
,,,run "$system$\mspaint.exe"
,,ifi-(win("Notepad" "Notepad"))
,,,run "$system$\notepad.exe"
,,mac "AppPositioner"
,,but(id(5 hDlg))
,,but(id(7 hDlg))
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case [5,7]
,,if(but(id(5 hDlg)) and but(id(7 hDlg)))
,,,ds1.SetPos(ds1.GetMaxPos/2)
,,,ds2.SetPos(ds2.GetMaxPos-20)
,,if(but(id(5 hDlg)) and !but(id(7 hDlg)))            
,,,ds1.SetPos(ds1.GetMaxPos-30)
,,,ds2.SetPos(0)
,,if(!but(id(5 hDlg)) and but(id(7 hDlg)))
,,,ds1.SetPos(20)
,,,ds2.SetPos(ds2.GetMaxPos)
,,if(!but(id(5 hDlg)) and !but(id(7 hDlg)))
,,,ds1.SetPos(20)
,,,ds2.SetPos(0)

ret 1


Function ExternalAppPositioner
Code:
Copy      Help
spe
rep
,int AppHwnd1=win("Notepad" "Notepad")    
,int AppHwnd2=win("Paint" "MSPaintApp")
,int AppFrameHwnd=win("App Frame" "#32770")
,int x_1 y_1 cx_1 cy_1 x_2 y_2 cx_2 cy_2
,
,GetWinXY id(3 AppFrameHwnd) x_1 y_1 cx_1 cy_1 ;;editable text
,GetWinXY id(4 AppFrameHwnd) x_2 y_2 cx_2 cy_2 ;;editable text

,MoveWindow AppHwnd1 x_1 y_1 cx_1 cy_1 1
,MoveWindow AppHwnd2 x_2 y_2 cx_2 cy_2 1
,Zorder AppHwnd1 HWND_TOP SWP_NOACTIVATE
,Zorder AppFrameHwnd HWND_BOTTOM
,


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)