Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding sub menu into window menu
#4
Gintaras Wrote:Any window? I think it is impossible or dirty/unreliable. You probably can get and modify menu using GetSystemMenu, but on click it will send WM_SYSCOMMAND to that window, not to you. Unless you intercept mouse clicks with a mouse trigger or mouse hook.

would that be a performance issue on my fast computer?

after searching for GetSystemMenu i found something Smile

Function __filedialog2
Code:
Copy      Help
function hwnd
0 hwnd
;int hwnd=win()
;int hc=child("" "CommonPlacesWrapperWndClass" hwnd)
int st = GetWinStyle(hwnd)
int x y cx cy; GetWinXY hwnd x y cx cy
int nx= 1600-cx/2
int ny=1200-cy/2
;if(st!=WS_THICKFRAME|WS_MAXIMIZEBOX|WS_MINIMIZEBOX)
;
,;SetWinStyle hwnd WS_THICKFRAME|WS_MAXIMIZEBOX|WS_MINIMIZEBOX 1|8
,;int sys_menu=GetSystemMenu(hwnd 0)
,;AppendMenu(sys_menu MF_BYPOSITION|MF_STRING SC_SIZE "&Size")
,;siz 800 600 hwnd 4
int slv
int hc=id(40965 hwnd)
if(!hc)
,;siz 800 800 hwnd 4
,int sys_menu=GetSystemMenu(hwnd 0)
,RECT rc; GetClientRect hwnd &rc
,_s.getwinexe(hwnd 1)
,str exe.getwinexe(hwnd)
,sel exe 1
,,case "dreamweaver"
,,,;slv=child("FolderView" "SysListView32" hwnd 0x1)
,,,;SetWinStyle hwnd WS_THICKFRAME|WS_MAXIMIZEBOX|WS_MINIMIZEBOX 1|8
,,,;AppendMenu(sys_menu MF_BYPOSITION|MF_STRING SC_SIZE "&Size")
,,,;;SetWinStyle slv WINAPI.LVS_REPORT|LVS_EDITLABELS 1
,,case ["qm","notepad++"]
,,,SetWinStyle hwnd WS_THICKFRAME|WS_MAXIMIZEBOX|WS_MINIMIZEBOX 1|8
,,,AppendMenu(sys_menu MF_BYPOSITION|MF_STRING SC_SIZE "&Size")
,,,0.2
,,,MoveWindow hwnd nx ny 800 600 1
,,,
,,,mov rc.right-80 500 id(1 hwnd)
,,,mov 0 500 id(1090 hwnd) 1
,,,mov 0 500 id(1152 hwnd) 1
,,,mov rc.right-80 530 id(2 hwnd)
,,,mov 0 530 id(1089 hwnd) 1
,,,mov 0 530 id(1136 hwnd) 1
,,,siz rc.right-10 400 child("" "SHELLDLL_DefView" hwnd)
,,case "aicon"
,,,SetWinStyle hwnd WS_THICKFRAME|WS_MAXIMIZEBOX|WS_MINIMIZEBOX 1|8
,,,AppendMenu(sys_menu MF_BYPOSITION|MF_STRING SC_SIZE "&Size")
,,,0.2
,,,MoveWindow hwnd nx ny 800 600 1
,,,;1040
,,,;
,,,mov rc.right-80 500 id(1 hwnd)
,,,mov 0 500 id(1090 hwnd) 1
,,,mov 0 500 id(1148 hwnd) 1
,,,mov rc.right-80 530 id(2 hwnd)
,,,mov 0 480 id(1040 hwnd) 1
,,,mov 0 530 id(1089 hwnd) 1
,,,mov 0 530 id(1136 hwnd) 1
,,,siz rc.right-10 400 child("" "SHELLDLL_DefView" hwnd)    
,,case "devenv"
,,,,sel _s.getwintext(hwnd)
,,,,,case "Komponente ausw�hlen"
,,,,,,siz 900 700 hwnd
,,,,,case "TabPage-Auflistungs-Editor"
,,,,,,siz 900 800 hwnd

,,case else
,,,;SetWinStyle hwnd WS_THICKFRAME|WS_MAXIMIZEBOX|WS_MINIMIZEBOX 1|8
,,,;MoveWindow hwnd nx ny 800 600 1
,,,;GetClientRect hwnd &rc
,,,;mov rc.right-80 500 id(1 hwnd)
,,,;mov 0 500 id(1090 hwnd) 1
,,,;mov 0 500 id(1152 hwnd) 1
,,,;mov rc.right-80 530 id(2 hwnd)
,,,;mov 0 530 id(1089 hwnd) 1
,,,;mov 0 530 id(1136 hwnd) 1
,,,;siz rc.right-10 400 child("" "SHELLDLL_DefView" hwnd)
,,,
,,,
,,,out "alt"
,
else
,;int w1=win("window name")
,
,str xx=""
,;out "neu"

,,

so the idea would be to use a left click trigger -> hit test sys.menu and then find out which item has been clicked?


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)