|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcsample98/html/vcsmpiconpro.asp
maybe it is some helpful to you
|
|
|
|
|
Dear WhiteSky,
Thank you for your help. I used the sample program to extract Icon from Dll or exe, that's great!! Now I am tracking the source code.
B.R
Bill Lin
|
|
|
|
|
I glad that you find your answer
Have a nice day
|
|
|
|
|
|
Dear WhiteSky,
I can't thank you enough. I had used SHGetFileInfo before, but I didn't try more... . Now I know the structure of Icon by your first response and how to use windows API to get more informations from a file by this response.
B.R
Bill Lin
|
|
|
|
|
F:\Installation\VC98\INCLUDE\vector(17) : error C2143: syntax error : missing ';' before 'namespace'
i get this error message but i already checked my syntax and it is correct. what should i do to correct this error?
|
|
|
|
|
What's the line that's causing the error.
Nibu thomas
Software Developer
|
|
|
|
|
thats the only error message i recieve.
|
|
|
|
|
What I meant was paste the piece code that cause the error so that we can take a look...
Have you included vector.h
Nibu thomas
Software Developer
|
|
|
|
|
this is the file on the include folder of MSVC++(VECTOR)
#ifdef _MSC_VER
#pragma pack(push,8)
#endif /* _MSC_VER */
_STD_BEGIN <-- this is shown by the error but i believe this is not the real error
// TEMPLATE CLASS vector
template<class _ty,="" class="" _a="allocator<_Ty"> >
class vector {
i also included the header file on my source code.
|
|
|
|
|
The problem could be this...
class AClass
{
}<code>
You use it like this...
<code>#include "anincludefile.h"</code>
#include "vector" Check and see if this is the problem...
Nibu thomas
Software Developer
|
|
|
|
|
Dear MFC friends,
I have a function for a combo box control in a dialog box,
void CLassnameDlg::OnCbnSelchangeComboboxControl();
I don't know why I could not do the following when the selection in the control has changed,
1. the content within the function doesn't work;
2. I could not do "Run To Cursor" within the function;
3. I set breakpoint at the right place within the function but doesn't work.
The type of the combo box control is "Drop List". In the same dialog I have several combo box controls, some are working and some are not working.
What's wrong? Could you please tell me?
Thanks,
Joy Anne
|
|
|
|
|
Scan the Message map section to find out if the combo that you are expecting to work is correctly mapped on to the function that you expect to get called for that particular combo.
Check the ID of the combo.
Nibu thomas
Software Developer
|
|
|
|
|
Hello
I am creating a win32 console application. I wanted to show output in full screen mode. I used following code by MSDN to do it. But nothing happens after when this code runs.
HWND hwndConsole = NULL;<br />
hwndConsole = FindWindow(NULL, "test.exe");<br />
if(NULL != hwndConsole)<br />
{<br />
SetForegroundWindow(hwndConsole);<br />
ShowWindow(hwndConsole, SW_MAXIMIZE);<br />
}
Please tell me what is "test.exe". Is it output file of my project.
Thank you.
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
Aqueel wrote: Please tell me what is "test.exe". Is it output file of my project.
Thank you.
Yes you are right.
It is trying to get the handle to the console window based on it's caption. This won't work. As caption contains the full path.
Aqueel wrote: But nothing happens after when this code runs.
This is because hwndConsole is NULL.
Do the following to get it working...
TCHAR oldTitle[MAX_PATH];
GetConsoleTitle(oldTitle, MAX_PATH);
TCHAR *newTitle = _T("My new title...zx1213");
SetConsoleTitle(newTitle);
HWND hwndConsole = NULL;
hwndConsole = FindWindow(NULL, newTitle);
if(NULL != hwndConsole)
{
SetForegroundWindow(hwndConsole);
ShowWindow(hwndConsole, SW_MAXIMIZE);
}
SetConsoleTitle(oldTitle); Nibu thomas
Software Developer
|
|
|
|
|
Hello
Now i have changed the path and now code is as follows.
HWND hwndConsole ;<br />
hwndConsole = FindWindow(NULL, "C:\\temp\\myapp.exe");<br />
if (hwndConsole == NULL)<br />
cout <<"Window not found"<<endl;<br />
if(NULL != hwndConsole)<br />
{<br />
SetForegroundWindow(hwndConsole);<br />
ShowWindow(hwndConsole, SW_MAXIMIZE); }
Here myapp.exe is name of my output file. But again nothing happens.
Thank you for your help.
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
Check the sample code that I've given.
Nibu thomas
Software Developer
|
|
|
|
|
Thank you Nibu!
I used your code. It works but it only maximizes the console window. It does not open in full screen mode. Can you tell me what i have to do?
Thank you.
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
Include this piece of code in main...
keybd_event(VK_MENU,0x38,0,0);
keybd_event(VK_RETURN,0x1c,0,0);
keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0);
keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0);
Nibu thomas
Software Developer
|
|
|
|
|
Thank you Nibu
I works... It's great. Can you please tell me what is the purpose of this piece of code. What it does?
Thank you
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
keybd_event(VK_MENU,0x38,0,0);
keybd_event(VK_RETURN,0x1c,0,0);
keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0);
keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0);
This simulates an Alt+Enter key combination. This is how we programmatically trigger a keyboard event.
1. First argument is the virtual key code of the key that is pressed. Here VK_MENU means Alt key.
2. The second argument is not required as per MSDN but here it won't work unless we pass the scan code. The second argument is the scan code of the virtual key.
3. The Third argument denotes whether it's key up event or key down event. If it is key down then we pass zero else we pass KEYEVENTF_KEYUP .
4. The fourth argument is for supplying any additional data.
Nibu thomas
Software Developer
|
|
|
|
|
On a side note, Windows is called Windows for a reason - if your going to force the user into fullscreen mode you'd be better asking them first.
Check out the MSDN documentation on SetConsoleDisplayMode[^], offically it only works on Windows XP upwards but i'm pretty sure it works on 2000 as well - it was just undocumented
For backwards compatibilty with other OS's you should really load it in dynamically and access it on the fly... code as follows:
typedef BOOL (WINAPI *PSCDM)(HANDLE, DWORD, PCOORD);
#define CONSOLE_FULLSCREEN_MODE 1 // From MSDN
#define CONSOLE_WINDOWED_MODE 2 // From MSDN
static PSCDM g_pfSetConsoleMode = NULL;
static BOOL g_bSetConsoleModeLoaded = FALSE;
BOOL MakeMeFullScreen( DWORD dwFlags )
{
HANDLE hStd = NULL;
COORD co = { 0, 0 };
if ( ! g_bSetConsoleModeLoaded )
{
HMODULE hDLL = LoadLibrary( TEXT( "kernel32.dll" ) );
g_pfSetConsoleMode = ( PSCDM ) GetProcAddress( hDLL, "SetConsoleDisplayMode" );
g_bSetConsoleModeLoaded = TRUE;
}
if ( g_pfSetConsoleMode == NULL )
return FALSE;
hStd = GetStdHandle( STD_OUTPUT_HANDLE );
if( ( hStd == INVALID_HANDLE_VALUE ) || ( hStd == NULL ) )
return FALSE;
return g_pfSetConsoleMode( hStd, dwFlags, & co );
}
Gavin Taylor
w: http://www.gavspace.com
-- modified at 6:10 Wednesday 15th March, 2006
|
|
|
|
|
Hi,
Can anyone tell me or refer me any document that tells in details as how Message Mappings are handled in a SDI application and MDI application. Most of the documents talks only abt the underlying concept of SDI/MDI, but i need to know as how the Message Maps are handled in these king of application.
Thanks in Advance
|
|
|
|
|
You may read Progrmmaing Windows 95 in MFC, written bij Jeff Prosise. It is already an old book, mebe there are some newer versions, but it explains very well how MFC works. It has a chapter on message handling.
Regards
Rudolf Heijink
|
|
|
|
|
Hi everybody,
In my dialog based application ,i should open up an "Notepad" when the user clicks an button in the dialog.I'm using
flushall();
system("notepad");
functions to open the notepad.Theproblem is when i open the notepad it opens up with the command prompt window and when i want to close the notepad the dialog doesnt gets repainted properly and it looks disfigured.It'll be really great if anyone can help me out in this.
Thanks and regards,
Rajeev
|
|
|
|