|
I'M VERY FRUSTRATED !! Using VC++ 6.0 - I have looked EVERYWHERE to see how to reactivate the dialog controls palette, but can't find any reference to it. (So REALLY REALLY stupid !!!) Please point me in the right direction !!!
Doug
|
|
|
|
|
Go to Tools, Customize, Toolbars tab, check 'Controls'.
Software Zen: delete this;
|
|
|
|
|
Thanks Gary, I just found it (literally 2 seconds before I saw your reply !!)
Doug
|
|
|
|
|
Hi guys,
I am developing a program that replaces executables icons with icons from other applications (executables) or from icon files. For now I am using this code in order to do it:
<br />
HMODULE hLibrary;<br />
HRSRC hResource;<br />
HGLOBAL hResourceLoaded;<br />
LPBYTE lpBuffer;<br />
HICON hIcon;<br />
int skip=0;<br />
<br />
hLibrary = LoadLibrary(icon);<br />
if((int) ExtractIcon(AfxGetInstanceHandle(), icon, (UINT) -1))<br />
for(unsigned long n=0;n<=1000000;n++)<br />
{<br />
hResource = FindResource(hLibrary,MAKEINTRESOURCE(n), RT_ICON);<br />
if(hResource)<br />
if(skip==IconIndex)<br />
n=1000001;<br />
else<br />
skip++;<br />
}<br />
else<br />
MessageBox("The icon file or the first file contains no icon");<br />
if(hResource)<br />
{<br />
hResourceLoaded = LoadResource(hLibrary,hResource);<br />
lpBuffer = (LPBYTE) LockResource(hResourceLoaded); <br />
hIcon=CreateIconFromResource((PBYTE)lpBuffer,SizeofResource(hLibrary,hResource),1,0x00030000);<br />
<br />
HANDLE hUpd=BeginUpdateResource(my_name,0);<br />
UpdateResource((HMODULE)hUpd,RT_ICON,MAKEINTRESOURCE(1),MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),lpBuffer,SizeofResource(hLibrary,hResource));<br />
EndUpdateResource(hUpd, FALSE);<br />
}<br />
FreeLibrary(hLibrary);<br />
So now I am using LoadLibrary, FindResource, LockResource to extract icon from executable or dll and then I use UpdateResource(...) to write icon to new exe. The problem is that this options does not suport icon files (.ico) and also it doesn't allow the user to extract the specified icon. I am using ExtractIcon() to get icon number.
Another way, more efficient and better would be to use ExtractIcon() to get icon form exe, dll or ico file. The problem of this mettod is that ExtractIcon() does not return a pointer to the data to be written by UpdateResource(...) instead it returns a HICON handle.
My question is how could I write this HICON handle to the new exe using UpdateResource(...). Itried several different methods but achieved one worked?
Please help anyone, this is very important to me.
Thanks.
|
|
|
|
|
Hi,
What I need to do is schedule some files to be deleted either at shutdown or at startup. My application can't do this because it is closing after it creates them and they need to remain there until shutdown. My app is currentlly creatting bat files for each of them and adds them to Startup folder in Start Menu. This method is inneficient though. For example how do uninstallers delete their executable at shutdown (startup)???
Thanks,
Andrew
|
|
|
|
|
you can run an application as windows starts up
you make an entry in registry
HKEY_LOCAL_MACHINE\Software\Microsoft\windows\CurrentVersion\Run
in this key you make an entry and give your applications full path ,
this application now will run every time you start computer.
Have a good luck.
|
|
|
|
|
I can't use another app that deletes the files due to project specifications. I need somenthing more simple. I have been using bat files until now the console window showing at every startup was annoying. Is there a way to hide this window?? How do uninstallers delete their own bodies after uninstall??
|
|
|
|
|
Anonymous wrote:
How do uninstallers delete their own bodies after uninstall??
See MoveFileEx() [^]
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Be carefull with the "MovefileEx" with the MOVEFILE_DELAY_UNTIL_REBOOT
From MSDN:
This value can be used only if the process is in the context of a user who belongs to the administrator group or the LocalSystem account.
|
|
|
|
|
Thanks, guys it worked.
Nemok
|
|
|
|
|
Remeber One thing MoveFileEx only Work In Windows Multiuser Editions,if you are targeting your application to Win98 then for deleting file at Startup you have to write the entry in the WinInet.ini
It's an INI file, however for deleting it's harder because the format is:
[rename]
NUL=C:\\temp\\file1.exe
NUL=C:\\foo\\file2.exe
and so on. You can't use WritePrivateProfileString()because
the second NUL line would replace the first. You need to read
the whole file in,modify it, and write it back it again
"I Think Believe this Will Help"
[Vote One Here, Complete my Survey....]
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
This seems to be something that's too simple to find an answer to, but it's starting to annoy me. All I know about C++ is what I've picked up myself, and I've never figure it out.
What's the difference between the types of include statements in C++? There's <thing>, <thing.h>, "thing.h", "c:\code\thing.h" etc. What's the difference? I know there's a difference, because changing the type has an effect on compiling.
Additionally, say I have a whole bunch of header files in a folder separate from where I'm working. Is there a way to set an environment variable or something so I don't have to type in the path to each one in its include statement?
Thanks for the help.
|
|
|
|
|
The only difference is where the file is included from.
#include "thing.h" - pick up thing.h from current directory
#include "c:\code\thing.h" - pick up thing.h from c:\code\ only (incidentally, this is really bad style - don't do this)
And the one you didn't specify:
#include <thing.h> - pick up thing.h from the include path
The include path is what you need to change to allow header files in a different directory to be found, without hardcoding the path (like the 'c:\code\thing.h' above).
How you change the include path depends on what compiler you are using, but if its VisualStudio then it should be pretty straightforward and you should look in the project settings.
You can have any number of include paths, and the compiler will look in each directory in turn. Make sure you don't have any duplicate headers otherwise you could confuse both yourself and the compiler!
|
|
|
|
|
Buy any good book on the language - a good investment.
Personally I have Herb Schildt's C++ Complete Reference.
Elaine
The tigress is here
|
|
|
|
|
I'm at that level where the beginner's books don't help and the reference guides are over my head. There's not much middle ground.
|
|
|
|
|
I display a dialog box when double clicking in my ActiveX control.
It works fine. But When try to move the dialog box by pressing on the title bar it hangs. Why ? Anyone can help me?
this is the code
where setProperty just passes an object address. in the dialog box class i have a pointer to that. it just asign to that.
void CImgAnnCtrl::OnLButtonDblClk(UINT nFlags, CPoint point)
{
propertyBox box;
box.SetProperty(&m_TmpProperties);
if(box.DoModal()==IDOK)
{
/// just some calculations
}
}
|
|
|
|
|
Try setting ooyur AciveX as parent for the dialog.. Maybe that will help.
propertyBox box(this);
|
|
|
|
|
i tried it but it hangs when i touch the title bar
|
|
|
|
|
The only thing I can think to try, without seeing if the dialog box is doing something strange, is to change changing the parent of the dialog box.
You can try the parent of the ActiveX control:
this->GetParent()
and if that does not work, try the desktop window
GetDesktopWindow()
|
|
|
|
|
Did you find a solution for this problem. I have the exact same behavior here. Everything works fine until I want to drag the window around. Then the dialog freezes and only keyboard navigation is possible.
I would really appreciate some hints!
Regards, mykel
If they give you lined paper, write the other way!
|
|
|
|
|
for all lost souls check this[^] thread.
regards,
mykel
If they give you lined paper, write the other way!
|
|
|
|
|
Dear All!
I'm doing program with MFC(Single Documents). I have a form. Now i want that when this form is running, it call a funtion in ---view Class. ---view Class called form Class.
Help me! Thank you!
|
|
|
|
|
CFrameWnd *pFrame;
pFrame = (CFrameWnd *)AfxGetApp()->m_pMainWnd;
CMyView *pView = (CMyView *) pChild->GetActiveView();
pViev->MyFun();
Where MyFun is your fun in View class.
Have a nice day
|
|
|
|
|
I can't wait to port my app to 64bit but it's in MFC! Will vs2005 support MFC's move to 64bit or is it not even an issue to worry about?
|
|
|
|
|