|
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
|
|
|
|
|
Use ShellExecute or CreateProcess .
A demo[^]
Nibu thomas
Software Developer
|
|
|
|
|
try to use ShellExecute(...) to open notepade.
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
ShellCreate(..),system(...) and CreateProcess are all opening the notepad ,but my actual problem is refreshing the screen(painiting it again) after the notepad is opened.How do i solve that
|
|
|
|
|
What You need to refresh screen?
|
|
|
|
|
SHELLEXECUTEINFO shell;
memset(&shell, 0, sizeof(SHELLEXECUTEINFO));
shell.cbSize=sizeof(SHELLEXECUTEINFO);
shell.lpVerb=_T("open");
shell.hwnd=m_hWnd;
shell.nShow=1;
shell.lpFile=_T("Notepad.exe");
ShellExecuteEx(&shell);
|
|
|
|
|
Normally this should not be a problem. To me it seems that you block your application somehow to proceed. I think system() is a call that blocks progress of the program invoking it. So while Notepad is active repainting will be prevented. Maybe using ShellExecute() in stead of system() will solve your problem.
Regards,
Rudolf Heijink
|
|
|
|
|
Hi all,
I've developed one dialog base application in which there is an edit box with multiline selection enabled.
after entering an text into the edit box, if i click "ENTER" key to get to the next line the application closes up.What could be the reason??
could anyone help me out in this please.
Thanks And Regards,
Rajeev
|
|
|
|
|
Make sure the ES_WANTRETURN is set on the edit control. Without this the dialog handles the keystroke and interprets it as a press of the default button (the button with a darker border around it). The dialog editor allows you to set this style.
Steve
|
|
|
|
|
rajeev82 wrote: if i click "ENTER" key to get to the next line the application closes up.What could be the reason??
Set the "Want return" property of the edit box to TRUE .
Nibu thomas
Software Developer
|
|
|
|
|
Thanks a Lot for ur help!!!!!!!!
|
|
|
|
|
Can i acess the remote database without using server ?
JAYARAJ
|
|
|
|
|
Can you explain more? You say you've got a remote database, I assume the term "server" refers to the machine it's on - So without the server there is no database?!?
Steve
|
|
|
|
|
i have SQL Server in my LAN
how can i acess database outside my LAN (i,e INTERNET)?
JAYARAJ
|
|
|
|
|
Hi,
I've one USB-to-Parallel cable. May I know if there's a way to write a VC++ program such that it's able to access individual bit of the parallel side?
The program is to be run in WinXP, Win2K, and possibly Win98.
Thanks.
|
|
|
|
|
i have intro to comp. programming and i was wondering if someone could help me out with a code here. its probably very easy, but im just not understanding.
Write a program that calculates the fine for a speeding ticket. Choose a base fine for violating the speed limit and an additional fine for each mile per hour over the speed limit. You decide what the speed limit is (be sure to tell the user what it is!) and the user enters the speed they are traveling (guaranteed to be over the limit). Output the miles per hour they were over and the fine.
it would b greatly appreciated.
J-Dub
|
|
|
|
|
We're not going to do your homework for you. Which part don't you understand?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
jwacho5 wrote: i was wondering if someone could help...
Yes, there are several here that could.
jwacho5 wrote: ...im just not understanding.
Which part exactly?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
First you need to define the bases: speed limit and fine. Take this as an example:
const int SpeedLimit = 100;
const int BaseFine = 500;
const int Additional = 10;
Then lets say that someone was running at 110MPH. It would be
int ActualSpeed = 110;
Ticket = BaseFine + ( ActualSpeed - SpeedLimit ) * Additional;
But be aware that this is only true if ActualSpeed is grater or equal to SpeedLimit, if it's lower you will wind up getting negative results, meaning that the cop would have to give money to the driver :->
Hope it helps
regards
hint_54
|
|
|
|
|
Is there exist a data structure or Algorithms which support operation such like Insert AND DeleteMinimum in constant time?
Welcome to my site:
http://www.cntomorrow.com:3310
|
|
|
|