|
You can do it, at design time, in the resource editor via the button properties->tab. But I don't remember how to do it at run time.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
|
Hi,
Iam new to win 32 programming. Currently i have a resource in a DLL consisting of dialog resouces and other. Now how do you i load the resouce in the DLL to my existing win 32 application?
Your help is greatly appreciated.
Thanks,
pradeep
|
|
|
|
|
And I need to do this at the runtime.
|
|
|
|
|
Here is an example as requested.
HMODULE hModule = LoadLibrary("C:\\another_resource.dll");
if(hModule != NULL)
{
HWND hDialog = CreateDialog(hModule, MAKEINTRESOURCE(ID_DIALOG), , );
HBITMAP hBitmap = LoadBitmap(hModule, MAKEINTRESOURCE(IDB_BITMAP);
FreeLibrary(hModule);
}
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
Use the LoadLibrary method to load your dll and call LoadResource to load the resources in it.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
hai,
I am not getting selected Date
I wrote code like these.....
Here m_month --- is CMonthCalCtrl member variable
Date Field is getting error.
Month and Year fileds are getting Correctly.
Plz Help me.
This is Urgent need..,
------->
CString strDate;
CTime ct;
m_month.GetCurSel(ct);
strDate.Format("%2d-%2d-%2d",ct.GetDay(),ct.GetMonth(),ct.GetYear());
MessageBox(strDate);
---
Praveen Chowdam Kumar
|
|
|
|
|
I think it's a known issue. The way to workaround this is by using SYSTEMTIME instead of CTime:
<br />
SYSTEMTIME ct1;<br />
<br />
if( m_month.GetCurSel(&ct1) )<br />
{<br />
strDate.Format(_T("%02d-%02d-%2d"),ct1.wDay, ct1.wMonth, ct1.wYear );<br />
MessageBox(strDate);<br />
}<br />
I hope that solves your problem,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
|
1.0 ??? Hasn't it been usefull?
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
-- modified at 6:33 Monday 29th August, 2005
|
|
|
|
|
Hi
I have developed a simple dialogue based application. This application contains only one static control in which I show some text continuously. Now I want to put a code so that when user presses some key combination like Ctrl + M, Ctrl+Alt+M or any key, it should be closed.
But my OnKeyDown() function doesn't work as I have Static Control on my dialogue and it takes the focus so all my key down event goes to static control.
Any idea what to do ?
Thankx in advance
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
You can attach an accelerator resource to your dialog. In the accelerator table, you can map the key combination to some command and then add an entry to the message map to specify a command handler.
Take a look at this posts[^] for details on how to attach the accelerator.
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thankx a lot
It will definitely help me a lot
Once again thankx for your kind response
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
You'll have to handle the WM_KEYDOWN message in PreTranslateMessage member function.
<br />
BOOL CYourDlg::PreTranslateMessage(MSG* pMsg) <br />
{<br />
if(pMsg->message == WM_KEYDOWN)<br />
{<br />
...
}<br />
return CDialog::PreTranslateMessage(pMsg);<br />
}<br />
I hope it helps,
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Modifing the above code can we find which particular key is pressed?
Thanx
V
|
|
|
|
|
pMsg->wParam right? GOT IT!!
Thanx
V
|
|
|
|
|
You're right !!
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
is it possible to capture other windows' events (without using Hooks?)
Thanx
V
|
|
|
|
|
Thank you very much for spending your time to read my question.
Still to apply what you have said....but I'll definitely try this one as well
Regards
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
Hello All,
I have implemented a simple "hello world" WIN 32 Application which displays a tray icon when application is running and removes tray icon when application is closed.
My problem is when i kill the applcation process from task manager, the tray icon still remains in system tray. When I move the mouse cursor over the tray icon then the tray icon is removed.
Will it be possible to remove the tray icon when application is killed from task manager.
Any help is truly appreciated?
Thanks and Regards,
Madhu
|
|
|
|
|
you need to call something like this before exiting your app:
Shell_NotifyIcon(NIM_DELETE, &nidIconData);
|
|
|
|
|
ooops, sorry, i guess i am still sleepy, i missed that "when killed from task manager" part
|
|
|
|
|
One important thing: killing an application is a really bad thing to do . When you kill an application, the clean-up code is not executed and that's why your icon still remains. The best solution to this problem: quit your application normally . Your application isn't supposed to be finished with the task manager killing it.
|
|
|
|
|
If you kill it by your task manager you can't predict what will happen and ensure that the icon is removed ...
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Thanks for the reply.
My application is launched from installation. The applcation runs similiar to daemon or service. So, i need to terminate the process during uninstallation. I am using TerminateProcess() to kill the applcation.
Is there any alternative solution?
Thanks & Regards,
Madhu
|
|
|
|