Exactly, I have now been proven correct.
Type: Posts; User: C_Sparky
Exactly, I have now been proven correct.
Nope, a good programmer wouldn't even consider the thought.
Both of you just relax, anyone good programmer would be able to survive this pain.
I don't think it's dangerous for this little project, as long as he eventually understands that scanf() is terrible to use.
You could just simply:
scanf("%s", &z);
This will grab the newline character was well, you'll still have the character you need in z.
Thanks for the replies, I will have to look for an alternative solution. And adeyblue don't worry I'm not trying to directly interact with the user from a service.
I realize that in order to set a global hook the process must have access to the user's desktop. And if a process is running as a Windows service (under the SYSTEM account), it doesn't have access to...
For those wondering what the solution is:
Create a new function to call during the message loop:
int process_keydown(HWND hwnd, MSG* msg)
{
if(msg->message == WM_KEYDOWN)
{
...
Thanks for the suggestions.
I'll just make a single global HWND variable, it only takes up 4 bytes :)
And GetDlgItem() is incredibly useful to this case
For a rather large program, with probably close to a hundred controls or maybe even more:
Would it be more practical to just store a global HWND variable for the main window, or to call FindWindow()...
I'm not familiar with using accelerator tables. However I just tried to implement one and have failed to make it work properly.
I'm following the procedure here: Using Keyboard Accelerators...
I have an application which displays files in a listview, and has several buttons to press for various functions.
I wish to capture the F5 key and the backspace key for the entire parent window,...
If you are using an IDE add "winmm" to the linker in project options.
You might also want to check out the music section in Charles Petzold's book, Programming Windows. You can find the code...
I'm really glad you brought this up. I am rewriting my functions to use the listviews(I have several for other parts of the program) to be used without global structures.
I'm still working on...
The Windows API helped me learn a vast amount about programming in general. It is good to know for anyone, since it is so rigorous compared to .NET, Qt, etc...
@OP:
I'd highly suggest Programming...
I do have it set up to when the user clicks on a treeview item, it goes up the parent nodes to the root node and gets the full key path, then calls a separate function to enumerate the values in the...
Not sure if I'm on the same page as you, but the treeview holds one value for each item(key name), which is stored in the treeview control. And the listview has 3 columns in which a global structure...
I've made a registry editor with a treeview for the keys and a listview for the values.
I use a global pointer to a structure to hold the list of values:
// in registry.h
struct value_t{
...
For Windows:
Set a windows hook with SetWindowsHookEx() (keyboard hook)
then use a callback procedure to process the keys being pressed
What compiler are you using?
Download the Windows Help files to the Win32 API
It comes in pretty handy.
Using the Win32 API:
-Create a function with a return type of VOID or DWORD WINAPI
-The function's parameter must be the type of LPVOID or void*
-Make a call to CreateThread() while passing the...
May not always be the case. I like Win32 for the full control, it's more difficult, but it's worth it to me.
I heart Win32. :)
whats the difference between:
return ::CallNextHookEx(sg_hGetMsgHook, code, wParam, lParam);
and
return CallNextHookEx(sg_hGetMsgHook, code, wParam, lParam);
Here is SparkPong, I made it with a decent and simple AI. You can change the speed of the paddles and the ball, as well as alter the difficulty of the AI.
Enjoy :)
Picture:...