|
Grid->SetFocus() resolves the problem.
For me, it's logical that a SetFocus()/SendMessage(WM_SETFOCUS) is too early
"...causes the set focus message to get queued, but other messages may execute before it affecting the focus." --> so the keyUp is affected and after this, the grid becomes the focus.
Big thanks to you
Yeah it's strange to change the focus with PageUp, but i re-code an existing DOS-program, which
should keep all keystrokes, because all users are used to use for example this kind of behavior.
The Tab-Key should switch into the different textboxes and a PageUp siwtches to another "section" of the Window
|
|
|
|
|
Hi
how can i open and read registry keys and values from the registry editor.
if any one has source code for this than please tell me .
or any type of help will make my application to move to other module
|
|
|
|
|
Look into MSDN for keyword CRegKey
I am not ashamed to confess that I am ignorant of what I do not know.
- Marcus Tullius Cicero
|
|
|
|
|
|
Jigish Shah wrote: how can i open and read registry keys and values from the registry editor.
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I have developed one application and I want it to run continuously in background of all the process like Google Desktop application.
can any one please tell me how can I achieve this task?
|
|
|
|
|
Can you create a WindowsService[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks for your reply.
But can you please tell me under which registry key this service is stored.
Suppose my exe name is ABC.exe and i want to create service for this exe to run in background.
As you send me link on that page they have given key
HKEY-LOCAL_MACHINE\SYSTEM\SERVICES
but can you please tell me under this key where i have to put my exe or where I have to create my new key to run my service in background for ABC.exe
Thanks again!!!!
|
|
|
|
|
It is not really enough to take a normal EXE and throw it into the Services entry in the Registry. A Windows Service is a special type of executable and needs to be written as such. A Windows Service supports control functionality, and the SCM, which manages Services, handles things like authentication and dependencies.
You should create a new Windows Service project. You should be able to use much of the boilerplate/wizard code as-is and just add your functionality to it.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Thanks James for your reply!!!
|
|
|
|
|
Hi all,
What am I doing wrong?
class TCP32CLIENT
{
public:
TCP32CLIENT_API void MsgBoxThreadProc(void *var);
};
void TCP32CLIENT::MsgBoxThreadProc(void *var)
{
...
}
bool TCP32CLIENT::setApplicationParameters()
{
int val = 1;
HANDLE handle;
handle = (HANDLE) _beginthread( &TCP32CLIENT::MsgBoxThreadProc,0,&val);
WaitForSingleObject(handle,7000);
...
}
Error: Error 6 error C2664: '_beginthread' : cannot convert parameter 1 from 'void (__thiscall TCP32CLIENT::* )(void *)' to 'void (__cdecl *)(void *)' c:\documents and settings\baileyr\my documents\tcpip project\tcp32client\tcp32client.cpp 166
Even if I do this:
...
handle = (HANDLE) _beginthread( MsgBoxThreadProc,0,&val);
...
I receive the following error:
Error 6 error C3867: 'TCP32CLIENT::MsgBoxThreadProc': function call missing argument list; use '&TCP32CLIENT::MsgBoxThreadProc' to create a pointer to member c:\documents and settings\baileyr\my documents\tcpip project\tcp32client\tcp32client.cpp 166
Many Thanx
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
It is because global functions and member functions of a class don't have the same prototype. For the member functions, there is an implicit parameter that is passed which is the 'this' parameter (identifies to which instance of the class it belongs to).
So, that's why your compiler complains. A solution is to use a static function: in that case, the member function doesn't belong to a specific instance of the class but is shared across all instances. In that case, the 'this' parameter is not passed but that also means that you can only access static members of your class in your static function.
|
|
|
|
|
Thank you very much for the help Cerdic.
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
we have developed one application in which we can download new updated exe from the ftp.
We got success in that process but while downloading new file taskmanager window shows the message Not Responding instead of running.
Can anyone tell me what's wrong going on in my application?
|
|
|
|
|
If the code is in the main thread, then your application won't be able to respond to GUI events (thus the 'Not Responding' message and the window will stay blank). You need to start your download in a separate thread for that.
|
|
|
|
|
Hi
thanks for giving me reply
But actually I am very new to VC++ programming so I don't know thread programming. So can you please provide me the whole details that what should I do to go ahead.
Thanks again!!!!
|
|
|
|
|
You can have a look here[^]. There are a lot of articles about this subject.
|
|
|
|
|
Oh!!!!
Thanks for your reply
|
|
|
|
|
Jigish Shah wrote: So can you please provide me the whole details that what should I do to go ahead.
Read here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
Actually my problem is like in my application client can download updated version of exe from our server.
We have made success to reach this part. But when user start downloading new exe after few seconds the TASKMANAGER window shows the message Not Responding instead of running.
So, this is the thing where I struck. I hope you will understand my problem.
if you find any type of solution than please tell me.
Thanks
|
|
|
|
|
James_Programmer wrote: So, this is the thing where I struck. I hope you will understand my problem.
I understand fully. Cedric has explained why and offered a solution. Did you implement it?
Check out SendMessageTimeout(hWnd, WM_NULL, ..., SMTO_ABORTIFHUNG, ...) for more.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
The "Not Responding" message appears if your application does not pump messages for a certain amount of time (I believe it is 5 seconds), and then a user tries to interact with it by activating it, clicking on it, etc.
The background thread suggestion(s) are the way to go, I just wanted you to understand exactly why that message appears.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi James,
Thanks for giving me reply but as per you told that I have to pump message continuously to keep running my application So, How can i pump message in background to do this?
I have used Spawnl() function in my application to replace my older exe to new one.
I hope you will understand the problem which I have faced.
Thanks again!!!!
|
|
|
|
|
You do not pump messages in the background, you download the updated EXE in the background. You do this by creating a background thread and having it do the FTP transaction, and your primary thread continues to pump messages and operate normally.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|