Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.09.24;
Скачать: CL | DM;

Вниз

Работа с PopUpMenu   Найти похожие ветки 

 
RebroFF   (2006-09-01 14:00) [0]

Вопрос такой:вызываю контекстное меню значка программы в трее, но после, по клику вне области меню последнее нагло не хочет убираться. Наверное нужно послать сообщение хендлу ПопАпа, но где, откуда и какое?


 
Steep ©   (2006-09-01 14:29) [1]

PostMessage(Handle, WM_NULL, 0, 0);


 
Steep ©   (2006-09-01 14:29) [2]

опть таки за неправильные коды в таком состоянии не несу...


 
RebroFF   (2006-09-01 16:49) [3]

А на какое событие посылать сообщение?


 
zdm ©   (2006-09-01 16:52) [4]

FindWindow


 
zdm ©   (2006-09-01 16:53) [5]

не, ступил, извини, а действительно интересная задачка как отловить окно не из своей программы??


 
DiamondShark ©   (2006-09-01 17:49) [6]

Вот про такие шаманские пляски с бубном пишут в Торе:

--------------------------------------------------------------------------------
TrackPopupMenu Function
<...>
Remarks
<...>
To display a context menu for a notification icon, the current window must be the foreground window before the application calls TrackPopupMenu or TrackPopupMenuEx. Otherwise, the menu will not disappear when the user clicks outside of the menu or the window that created the menu (if it is visible). However, when the current window is the foreground window, the second time this menu is displayed, it displays and then immediately disappears. To correct this, you must force a task switch to the application that called TrackPopupMenu at some time in the near future. This is done by posting a benign message to the window or thread, as shown in the following code sample:


  SetForegroundWindow(hDlg);

  // Display the menu
  TrackPopupMenu(   hSubMenu,
                    TPM_RIGHTBUTTON,
                    pt.x,
                    pt.y,
                    0,
                    hDlg,
                    NULL);

  PostMessage(hDlg, WM_NULL, 0, 0);

--------------------------------------------------------------------------------

В переводе на дельфиний

  SetForegroundWindow(PopupList.Window);
  PopupMenu1.Popup(X, Y);
  PostMessage(PopupList.Window, WM_NULL, 0, 0);



Страницы: 1 вся ветка

Текущий архив: 2006.09.24;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.069 c
15-1156787243
Некто
2006-08-28 21:47
2006.09.24
IP-адрес виндового роутера по умолчанию.


4-1146608062
vidiv
2006-05-03 02:14
2006.09.24
"Виртуальный" файл


15-1157452753
rerfhtre
2006-09-05 14:39
2006.09.24
tcpdump: dmp files


2-1157531619
webpauk
2006-09-06 12:33
2006.09.24
как определить в каком столбце DBGrid юзер кликнул мышью?


15-1157266346
Ketmar
2006-09-03 10:52
2006.09.24
Gero, ты клиента чинить будешь?