Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Toolbar Move...
#1
Can never get this! I've gotten it before, but I'll end up having my files erased & go to try it again, & I can't figure it out! I know it's very simple, What I am trying to do is have a Toolbar move to the exact place in the window everytime it is triggered when the 'specified' window is opened , I WANT IT TO GO TO THE SAME PLACE IN ITS TRIGGERED WINDOW, EVERY TIME, EVEN IF THE WINDOW DOESN"T OPEN IN THE SAME PLACE ON EVERY BOOT...
-
Here is what I got. Appreciate the help:
-
Function Name=tb_ow_call
Trigger=!cv"- Notepad" "Notepad" <--- Works Fine.
-
Toolbar Name=Toolbar
Trigger=None
-
Toolbar code=
Toolbar
Code:
Copy      Help
;/siz 38 350 /isiz 32 32 /

Men < File < New < Blank :int+ OW=GetToolbarOwner(TriggerWindow); mac "Menblank" * $qm$\new.ico
;;running VISTA, that's why I'm using GetToolbarOwner command.
Close Notepad :int+ OW=GetToolbarOwner(TriggerWindow); mac "Cnp" *close.ico

tb_ow_call Code=Function
Trigger !cv"" ""     Help - how to add the trigger to the macro
Code:
Copy      Help
int hwnd=val(_command)
siz 355 175 hwnd ;; <--- Size Notepad.
mac "Toolbar" hwnd;; <--- run toolbar, Trigger is !cv"- Notepad" "Notepad"
int a=GetWindow(win() GW_OWNER) ;;Gets Toolbar Windows Owner. Pretty Much already gotten from the Trigger...
mov 151 166 a ;;<--- This is where I'm stuck, it moves it, but if notepad does not open in the same place every time, it goes somewhere differn't, PLEASE HELP ME, I have tons of macros that need this!

Please help, I just need the toolbar to open in the same exact place in the window every single time, as if it has it's own Slot to automatically goto!

Thanks, Scott!
#2
example with Notepad and its Find dialog

Macro
Code:
Copy      Help
;moves Find dialog to x y relative to Notepad window

int x=100
int y=200

int w1=win("Untitled - Notepad" "Notepad")
int w2=win("Find" "#32770")

RECT r; GetWindowRect w1 &r
mov r.left+x r.top+y w2


Forum Jump:


Users browsing this thread: 1 Guest(s)