Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dialog exe format, convert drag to rect and image
#1
Below I have a dialog with 2 buttons
- 3. SHOW DRAGGED AREA DESKTOP
- 4. SCREENSHOT DRAG

  • Button 3 (is disabled at start):
    As soon as the user finished dragging an area on the desktop, the dialog will enable button 3 and when pressed will output the 4 rect area points

  • Button 4 clicked:
    In QM there is a function within "Wait" > "Wait for color" > "Capture", as soon as you click that button "Capture", a desktop snapshot is displayed with a yellow marked rectangle with text "This is a snapshot..." (disappears after a few seconds).
    Now when button 4 is clicked it displays a full desktop snapshot exactly like the "capture" function with the yellow marked text that disappears.
    Then when the user drags area over that snapshot it saves the rectangle area to a screenshot.

I have no idea how to approach the drag subject in exe format (if it is even possible because of exe limitations?).


Function DragThenUseRectpoints
Code:
Copy      Help
;\Dialog_Editor

str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 199 91 "Dialog"
;3 Button 0x54032000 0x0 40 9 129 30 "3. OUTPUT POINTS DRAGGED AREA DESKTOP"
;4 Button 0x54032000 0x0 39 49 130 32 "4. SCREENSHOT DRAG"
;END DIALOG
;DIALOG EDITOR: "" 0x2040202 "*" "" "" ""

if(!ShowDialog(dd &sub.DlgProc 0)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,,RECT- r
,,EnableWindow id(3 hDlg) 0
,case WM_DESTROY    
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,,;; ..... ?    
,,out r.left
,,out r.top
,,out r.right
,,out r.bottom
,,
,case 4
,,;; ....    ?    
,,str saveTo="$desktop$\new.bmp"; saveTo.UniqueFileName
,,CaptureImageOnScreen r.left r.top r.right r.bottom saveTo

,case IDOK
,case IDCANCEL
ret 1
#2
Function DragThenUseRectpoints
Code:
Copy      Help
,,if(!CaptureImageOrColor(0 0 hDlg saveTo r)) ret
,,EnableWindow id(3 hDlg) 1
#3
WOOW!
It works!!!
I thought this would be very complex.
Was looking for WM_DRAG kind of messages in MSDN (and all other kinds of WM_ messages...)
Totally forgot to look in the "System" folder :oops: (*bangs head on desk*)

Thanks!!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)