|
Are you talking about while your program is running or just get the icon from another application?
If you simply need the icon from another application, you can load the exe of that application into Dev Studio and extract the icon.
If you need the icon while your program is running that will be a little more difficult. What you need to do is get the top level window of that application, and call GetClassInfo . This will give you a WNDCLASS structure that will allow you to get the HICON.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I can't seem to get GetClassInfo to work with an HINSTANCE of an external module. Does this function only work with the HINSTANCE of the current process?
|
|
|
|
|
Hi,
I need to be able to perform screen captures at a high frame rate. So far, I get reasonable performance when I use the BitBlt function to copy the bitmap from the window DC to the memory DC. The problem lies in GetDIBits...this function is incredibly slow and adds considerable bottleneck to the system.
The thing is, I need to be able to use each of the captures in real time. Converting them to DIBs later isn't an option.
Is there a faster option than to use BitBlt/GetDIBits to capture each screen? How about comparing each successive bitmap and using only the deltas...can this be done quickly?
Thanks!
|
|
|
|
|
Yes, copy the screen to a DC that contains a DIBSection - you then have a pointer to the bits at all times.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
|
|
|
|
|
The main problem in your slowness extends from the fact that the transfer of the bits from video memory to system memory is very slow. I was able to speed up the screen capture with DirectX, however I was only able to shave off about 200 milliseconds off of a 1.3 second screen capture process.
You are not going to get much faster with the technique that you are using. You may want to look at how NetMeeting does this. They create a second display driver that is able to capture the updates to the screen before they happen, and log the deltas in the bitmap. Then operate only on the deltas.
There is a function that will allow you to detect the rectangle of the changes for a DC, but it only works on memory DCs, and I cannot remember the name of it right now.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Why is it required to place a scope resolution operator when writing code out for class functions, and why does it cause a syntax error?
Loli10
|
|
|
|
|
it's necessary because that's how the compiler knows which class to attach the code to, so to speak. without it, you'd need to have unique names for every function in every class - which makes inheritance pretty much impossible.
-c
Civilization is the limitless multiplication of unnecessary necessities.
Mark Twain
|
|
|
|
|
As Chris has already said, it lets the compiler associate a function's implementation with a class. My point is that you can separate a large class (i.e. one with many functions) into different files. Also (not recommended), the same .cpp file can contain functions of more than one class.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
How must i set the parameters for the function FindFirstFile() if i want to get the shared files which are located at a remote machine!!
I have tried FindFirstFile("\\\\machnine\\*",&data);
and FindFirstFile("\\\\machnine\\",&data); and
FindFirstFile("\\\\machnine",&data);
and much more else but i have always got the error code ERROR_INVALID_NAME!!
Please help me!!!
|
|
|
|
|
If you are using a UNC name it must be fully qualified.
FindFirstFile("\\\\machnine\\share_name\\*.*",&data);
|
|
|
|
|
Can I have my VC6 still installed on my computer and install Visual Studio .NET on the same computer without any kind of trouble!?!?!?!
------------------------------------
Rickard Andersson, Suza Computing
ICQ#: 50302279
I'm from the winter country SWEDEN!
------------------------------------
|
|
|
|
|
Yes, but don't come looking for me if it doesn't work.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Yes! I wondered the same thing after installing VS.NET on my new HDD and watching it kill all my old code. Not wanting to distribute the version 7 .DLLs on my webpage for the next version of my program anyway, I installed VC6 and it's co-existing perfectly, much to my surprise actually. So I can pick up where I left off without having to fix a million broken things, and I can still use ClassWizard.
- Jason
(SonorkID 100.611)
"The sort of guy who'd give the kid an extra scoop of ice cream free if he was an ice-cream man"
- Nish, on Chris Maunder
|
|
|
|
|
I've never had problems installing both.
- Matt Newman / Windows XP Activist
-Sonork ID: 100.11179:BestSnowman
†
|
|
|
|
|
I need to create an visio-like userinterface, (especially resizing and moving objects) Does windows provide any scaling or moving functions which can be used ?
|
|
|
|
|
GDI+ does.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
|
|
|
|
|
I deleted to source files from my project directory thinking that would remove them from the project. Now the darn thing won't compile. I keep getting "fatal error C1083: Cannot open source file: 'D:\Projects\My Proj\IntDlg.cpp': No such file or directory
What do I do now!?!
Why not throw away a dime?
I throw away ten pennies all the time.
|
|
|
|
|
Using the File View portion of the Workspace toolbar, simply highlight the offending source files, and hit the Delete key. This will remove the files from your project, and they will no longer be compiled. Hope this helps.
|
|
|
|
|
D'uh! I can't believe I forgot that! Oh well. This is my first day programming VC++ again for a few months. Thanks for the help.
Why not throw away a dime?
I throw away ten pennies all the time.
|
|
|
|
|
Also remember to remove all #includes to the deleted files
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
Do you needs those files. Look in the recycle bin.
Or go into your project and click on the file in your project view, and hit hte delete key to delete them from the project.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Check the recycle bin just in case VS is nice enough to copy it there for you.
Failing that...
Go to VSS or whatever you're using as a source repository and get the latest version.
Failing that...
Go to your trusty backup (CD, tape, floppy, etc) and get the last backed up version.
Failing that...
Get typing! Dialogs don't just write themselves!
J
|
|
|
|
|
I need to write a system try app that performs single frame capture on a right mouse click. It also has to run under Windows 98.
The system try stuff I knwo myself. For the right mouse click, presumably I need a mouse hook, because the app won't have focus (in the tray). For the difficult bit, presumably I need to use DirectX (specifically DirectShow?). Anyone got any ideas, sites, source code that could help me out (with the mouse hooking and DirectX specifically)?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
You mean of the screen ? No DX required.
CWindowDC dc(NULL); // You now have the entire screen in a device context
You can now blt the contents of this DC into another to get a bitmap of the screen in a format you can work with, without drawing to the screen itself....
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"But there isn't a whole lot out there that pisses me off more than someone leaving my code looking like they leaned on the keyboard and prayed that it would compile.
- Jamie Hale, 17/4/2002
|
|
|
|