Search Results

Showing results 1 to 40 of 818
Search took 0.04 seconds.
Search: Posts Made By: William Hemsworth ; Forum: C++ and child forums
Forum: C++ 10 Hours Ago
Replies: 5
Views: 125
Posted By William Hemsworth
So you want to swap keys around, for example the user presses 'INSERT', 'A' is pressed instead? You don't need to use SendInput, it's much simpler to use keybd_event, so you can change that case...
Forum: C++ 1 Day Ago
Replies: 5
Views: 125
Posted By William Hemsworth
Misread the question, but that's still a great way to detect keypresses, the rest shouldn't be hard.
Forum: C++ 1 Day Ago
Replies: 5
Views: 125
Posted By William Hemsworth
Really not the best way to detect keystrokes, I'd suggest a Windows hook, because you can actually change what the output of that key will be. For example, here's how you could turn the Space bar...
Forum: C++ 2 Days Ago
Replies: 9
Views: 147
Posted By William Hemsworth
Good (: You can flag the thread as solved at the bottom.
Forum: C++ 2 Days Ago
Replies: 9
Views: 147
Posted By William Hemsworth
I edited my post maybe before you tried that code, try again. There's no reason why that function shouldn't work, if it still doesn't work, show me the code you're using.
Forum: C++ 2 Days Ago
Replies: 9
Views: 147
Posted By William Hemsworth
Either turn UNICODE off, or change the code to:#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <iostream>
#include <fstream>

void saveCaption(HWND hwnd, TCHAR *filename) {
int...
Forum: C++ 2 Days Ago
Replies: 9
Views: 147
Posted By William Hemsworth
Wouldn't usually give away code, but it's just so small.#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <iostream>
#include <fstream>

void saveCaption(HWND hwnd, char *filename) {
...
Forum: C++ 2 Days Ago
Replies: 3
Views: 255
Posted By William Hemsworth
Got it working with objects and bitmaps, I think with some optimizations I could use this to make some neat games :)
Forum: C++ 3 Days Ago
Replies: 3
Views: 255
Posted By William Hemsworth
Another really nice effect using this method :icon_smile:
Forum: C++ 4 Days Ago
Replies: 3
Views: 255
Posted By William Hemsworth
Here's a speed test :) mine stays at about 480fps with only 2-3% CPU.
Forum: C++ 4 Days Ago
Replies: 3
Views: 255
Posted By William Hemsworth
Quite a while ago, I made this (http://www.daniweb.com/code/snippet217147.html) snippet. This code is basically the same, except that it adds animation.

This method of blitting is very fast...
Forum: C++ 5 Days Ago
Replies: 8
Views: 268
Posted By William Hemsworth
Of course Win32 Gurus would use the Win32 API, it's what they're good at, that doesn't mean it's the best thing to use.

Qt is multi-platform, whereas the Windows API isn't, if the platform doesn't...
Forum: C++ 5 Days Ago
Replies: 7
Solved: memory leak
Views: 214
Posted By William Hemsworth
Check variables that you allocated memory on, and make sure you deleted it somewhere else in the code. If you forget to free any memory, that's a memory leak.
Forum: C++ 5 Days Ago
Replies: 4
Views: 217
Posted By William Hemsworth
Oops, sorry AD :icon_eek: that was supposed to be +rep!
Forum: C++ 9 Days Ago
Replies: 3
Views: 198
Posted By William Hemsworth
Any useless junk that's there would have been a result of your programming, the generated assembly is pretty efficient.
Forum: C++ 10 Days Ago
Replies: 3
Views: 211
Posted By William Hemsworth
C++ isn't really decompilable, it's possible to turn the machine code back to C-Instructions with meaningless variable names, but nobody will get anywhere with a 10000 line program.
Forum: C++ 12 Days Ago
Replies: 14
Views: 377
Posted By William Hemsworth
Now you know another, my entire personal library is wrapped in a number of namespaces, without them it would be chaos.
Forum: C++ 13 Days Ago
Replies: 7
Views: 366
Posted By William Hemsworth
I made a little snippet that allows you to directly access the pixels and save it as a .bmp. [link] (http://www.daniweb.com/code/snippet217147.html) I've simplified it a little for you.#include...
Forum: C++ 22 Days Ago
Replies: 3
Views: 179
Posted By William Hemsworth
Then make a new file, copy only the content you need from the first one, delete the first file, and rename the second file.
Forum: C++ 23 Days Ago
Replies: 3
Views: 261
Posted By William Hemsworth
Yes, but to draw to it you need its HDC. This kind of drawing with the Windows API is hell, I'd say if it's possible, use a graphics library, if not you might be spending a while trying to get it to...
Forum: C++ 23 Days Ago
Replies: 3
Views: 261
Posted By William Hemsworth
You will have to create a temporary surface to draw on for that one line, and when you release the mouse, it copies that surface to the main one.
Forum: C++ 26 Days Ago
Replies: 1
Views: 196
Posted By William Hemsworth
In version 8, you can just do it from the dialog interface, scroll down to the 'Menu' option, and select the name of the menu you created (view screenshot)

If you can't do that, you could edit the...
Forum: C++ 28 Days Ago
Replies: 4
Views: 171
Posted By William Hemsworth
He didn't write the code, nor does he understand it, so he's asking for someone to baby him through each line.
Forum: C++ 28 Days Ago
Replies: 4
Views: 171
Posted By William Hemsworth
No, nobody is going to explain that badly formatted C code to you which should have been wrapped in code-tags. You clearly didn't write it, so what I suggest you do is learn how to program, buy a...
Forum: C++ 30 Days Ago
Replies: 34
Views: 1,177
Posted By William Hemsworth
Well, C++ can compile almost any C code, except for a few minors differences. Post the code and I'll see.
Forum: C++ 30 Days Ago
Replies: 3
Views: 202
Posted By William Hemsworth
Your condition for that loop is:(s[i] != '\0') || (s[i] != ' ')Now think, is there any way that expression will ever be false in order to break out the loop? If s is a null-terminator, the loop wont...
Forum: C++ 30 Days Ago
Replies: 8
Views: 382
Posted By William Hemsworth
Pretty much, if you want to use the Win32 API, the code will look very similar to C, but that's why they made MFC.
Forum: C++ 31 Days Ago
Replies: 2
Views: 506
Posted By William Hemsworth
I had never even heard of a negative base until you said that, I looked it up and it seems interesting. But, this function already uses a sign to represent negative numbers, maybe I could make a...
Forum: C++ 31 Days Ago
Replies: 2
Views: 506
Posted By William Hemsworth
Here's a function that manually converts an integer to any base between 2 and 36, the parameter list is:
void toBase(
int value, // Integer value to convert
char *target, // Pointer to a...
Forum: C++ 31 Days Ago
Replies: 10
Views: 337
Posted By William Hemsworth
I'll stick with just the code please ;)
Forum: C++ 31 Days Ago
Replies: 10
Views: 337
Posted By William Hemsworth
It's worth a shot, just copy the project, delete unneeded compiler generated files, zip it and attach here :)
Forum: C++ 31 Days Ago
Replies: 10
Views: 337
Posted By William Hemsworth
Obviously the use of arrays here has made this very confusing, maybe it's possibly to do without, I don't know. But all I can suggest is to try using global variables and message notifications too,...
Forum: C++ 32 Days Ago
Replies: 10
Views: 337
Posted By William Hemsworth
So let me get this right, you basically have an array of hWnd's which all link to the same event handler, but you want to do different things with each of them in the messengerBox dialog when it's...
Forum: C++ 32 Days Ago
Replies: 10
Views: 337
Posted By William Hemsworth
Can't say I do, hWnd will hold the handle to the window being used, so can't you just write:ShowWindow(hWnd, SW_HIDE);If not, you will have to clarify :P

Posting / Attaching the whole code would...
Forum: C++ 32 Days Ago
Replies: 3
Views: 233
Posted By William Hemsworth
What's this? You just supplied an entire program when all he wanted was help on one case.
Forum: C++ 34 Days Ago
Replies: 9
Solved: Adding Sounds
Views: 440
Posted By William Hemsworth
Perhaps the PlaySound (http://msdn.microsoft.com/en-us/library/aa909766.aspx) function?
PlaySound("H:\\sissys.mp3", NULL, SND_FILENAME);
Forum: C++ Oct 25th, 2009
Replies: 2
Views: 182
Posted By William Hemsworth
What are the errors?
Forum: C++ Oct 24th, 2009
Replies: 3
Views: 143
Posted By William Hemsworth
Depends on so many things, it could take a month if you did it intensively, or a year or two if you do it as a hobby every once in a while.
Forum: C++ Oct 24th, 2009
Replies: 11
Views: 384
Posted By William Hemsworth
I know.. that's what I said. By the way, don't use void main, use int main, and use code-tags when posting.
Forum: C++ Oct 24th, 2009
Replies: 2
Views: 223
Posted By William Hemsworth
My best advice for you right now is to learn how to program before you try anything big. Read books, tutorials, whatever.
If you plan on doing this in Windows, you should try this tutorial [link]...
Showing results 1 to 40 of 818

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC