|
|
aroli vijay wrote: i have seen a code which does the same thing, but it does not work for windows9X. can anyone give me any information about this??
So shouldn't we know what this is so as not to suggest something you've already tried?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i want to know which windows message is recieved by my Dialog based application that forces it to minmize
as such Show desktop or Windows Logo +D would minimize all the window to the taskbar , But the thing is that i want to handle it differently
So if i could find out which message it sends to me
i.e. in terms of WM_.....
SO THAT I COULD OVERIDE IT
One more thing is that i am able to get the control of the first (indows Logo +D ) i.e. int the handler of
WM_SIZE IN THAT wparam= SIZE_MINIMZED
IT WORKS TOO but as such when i m pressing it the second time without doing any operation than i am not able to handle it
in WM_SIZE with Wparam= SIZE_MAXIMIZE
i don't know how but my application gets popup and is displayed in an unwanted manner.
payal
|
|
|
|
|
payal335 wrote: want to know which windows message is recieved by my Dialog based application that forces it to minmize
as such Show desktop or Windows Logo +D would minimize all the window to the taskbar , But the thing is that i want to handle it differently
So if i could find out which message it sends to me
Did you try WM_SYSCOMMAND with SC_MINIMIZE .
|
|
|
|
|
this does not work as it works only when we try to minimize our application from the task bar by click in on our application area on the task bar
the thing is that the Shell_TrayWnd program sends message to all the application to minimze
val
/*MinAll*/ 415,
/*MaxAll*/ 416,
accordingly
static HWND hShellWnd = ::FindWindow(_T("Shell_TrayWnd"), NULL);
if(hShellWnd != NULL)
::PostMessage(hShellWnd, WM_COMMAND, MAKELONG(415, 0), NULL);//for minimizing
::PostMessage(hShellWnd, WM_COMMAND, MAKELONG(416, 0), NULL);//for maximizing
This stuff will minimize all the window
payal
Developer
|
|
|
|
|
payal335 wrote: the thing is that the Shell_TrayWnd program sends message to all the application to minimze
val
/*MinAll*/ 415,
/*MaxAll*/ 416,
accordingly
static HWND hShellWnd = ::FindWindow(_T("Shell_TrayWnd"), NULL);
if(hShellWnd != NULL)
::PostMessage(hShellWnd, WM_COMMAND, MAKELONG(415, 0), NULL);//for minimizing
::PostMessage(hShellWnd, WM_COMMAND, MAKELONG(416, 0), NULL);//for maximizing
This stuff will minimize all the window
I guess you quoted this from my own article...
Well the shell tray window has to somehow communicate with your window, so I guess it will send a message to your window and that should be minimize.
Try out WM_SHOWWINDOW , WM_SYSCOMMAND . These should help.
|
|
|
|
|
Try out WM_SHOWWINDOW, WM_SYSCOMMAND.
no it is not working
|
|
|
|
|
payal335 wrote: Try out WM_SHOWWINDOW, WM_SYSCOMMAND.
no it is not working
I guess its WM_SIZE with SIZE_MINIMIZED as WPARAM value.
|
|
|
|
|
Hi everyone !!
I've a dialog based application in which I've added a context menu. I had previously defined a menu similar to file menu which works fine.
Recently I added a context menu for one of the dialogs. It is not working
I checked the resource file for any duplicate id's and corrected that also but nothing seems to be helping me.
Here is what I did.
1. Added a context menu in Resource->Menu.
2. Added a context menu command handler for that dialog.
3. Added command handler for each of the ID in this menu.
When I compile, build and run the application it gives no errors but the commands from this context menu are not working.
When I try implementing a context menu with another project it works fine.
Please help
Thanks,
Gajendra
|
|
|
|
|
Can you show a snippet code
|
|
|
|
|
This is in message maps:
ON_COMMAND(ID_DIR_REVN_MENU, On_Dir_Revn_Menu)
-----------------------------------------------------------------------
I've customised the display of context menu to deligate to another function. The context menu code is loaded properly and displayed.
// called from the original OnContextMenu
void CFPLN_PAGE_Dialog::On_Fpln_Revn_Menu(CPoint point)
{
point.x = 90;
point.y = 95;
ClientToScreen(&point);
CMenu m_Fpln_Revn_Menu, *m_Ptr_ContextMenu;
m_Fpln_Revn_Menu.LoadMenu(IDR_FPLN_REVN_MENU);
m_Ptr_ContextMenu = m_Fpln_Revn_Menu.GetSubMenu(0);
ASSERT(m_Fpln_Revn_Menu);
m_Ptr_ContextMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON, point.x, point.y, AfxGetMainWnd());
}
-----------------------------------------------------------------------
Then the command handler code is:
void CFPLN_PAGE_Dialog::On_Dir_Revn_Menu()
{
// TODO: Add your command handler code here
AfxMessageBox("dir revn menu");
}
Is this ok for you to guess something...?
Let me know if you want to know more about the problem. You can mail to me: "gajendra.kashyap@valtech.co.in"
Thanks,
Gajendra
|
|
|
|
|
Whats problem with this code it work,when you run this code you see a contextmenu in 90x95(create a menu in resource and event handler and run ...not problem)but you need to use
CPoint point;<br />
GetCursorPos(&point);
instead point.x&point.y=value.<br />
|
|
|
|
|
The problem is that the commands from context menu are not working. The corresponding mapped function is not called when something is selected in the menu.
Gaj
|
|
|
|
|
Are you sure ids are unique it seems you code doesnt has a problem
|
|
|
|
|
Yes the IDs are unique. I've ResOrgAddin tool to check that. I got the problem just a few mins back.
I don't know if I can load an image here but the I'll try to explain the design.
I've a main dialog for the application, lets call this parent. I've several child dialogs which are displayed overlayed on this parent dialog.
I implemented context menu only for one of the child dialog... it did not work as expected. Although the context menu was displayed the commands were not getting generated ... Surprising.
Now I implemented the contextmenu on the parent dialog and it works as expected jst need to control the display on right dialog. I don't think it is the right way to do... but it is working.
If i could send and handle the commands from the right dialog on which context menu is displayed would be the best situation.
Let me know your valuable opinion.
Thanks,
Gaj
|
|
|
|
|
Im wondering you are using same code in two place parent and child in parent its working and in child its not working you can show context_menu but you cant run items in this menu on child menu.I tested like you step to step and it worked
|
|
|
|
|
Can you explain me your design if it differs from mine in some way?
thanks for your help.
Gajendra
|
|
|
|
|
well im writting a program (a parent dialog and a child) and then:
(1)Create a menu in resource and declare handler for items in main class
(2) im creating a button and insert these codes to it
<br />
<br />
CMenu m_Fpln_Revn_Menu, *m_Ptr_ContextMenu;<br />
<br />
CPoint point;<br />
GetCursorPos(&point);<br />
<br />
m_Fpln_Revn_Menu.LoadMenu(IDR_MENU1);<br />
m_Ptr_ContextMenu = m_Fpln_Revn_Menu.GetSubMenu(0);<br />
<br />
m_Ptr_ContextMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON, point.x, point.y, AfxGetMainWnd());<br />
(3) and running my program
(4)when im clicking this button i can see a context_menu and when i click on items these works
(5) then im writting like these codes for child dialog and its working
Now you have this prolem with all your programs or only this program
|
|
|
|
|
I have problem with only this one becuase it works on others. I can't reveal the complete code to you
But its ok, I think I know the solution what needs to be done.
Thanks much for your time and help.
Regards,
Gajendra
|
|
|
|
|
if you create a new menu and repeat this stage whats happen?same problem
|
|
|
|
|
Till now I had only single context menu for that dialog. Will try to add another one for another dialog and lets see then.
Regards,
Gajendra
|
|
|
|
|
Hi,
I am trying to use bellow SQL in VC++ but when the I run it does not read the % which will not gave me the correct results:
SELECT * FROM ABC WHERE (CC LIKE N'%'"+ txt +"'%')
I looked on the net for similar situation but all use the text it self not variable (txt is CString), any suggestions to solve this.
Thanks and Best Regards,
Rasha
|
|
|
|
|
I don't think that the SQL syntax is correct. Have you tested it before? Are you trying to select records where the CC field starts with N and in has the provided text inside it?
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
is it mr Marcdev?
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
|
|
|
|
|
Touché!!
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|