I want to bring the window that has been activated before my application's window in the z-order and set keyboard focus to it. there are 3 API related to this job in Windows APIs: BringWindowToTop (...) SetActivatedWindow (...) SetForegroundWindow (...) I've been trying all possible combination of these functions since yesterday, but I failed. The problem is I can bring the windows I like to the front, but those never get keyboard-focused. I've also tried ShowWindow (...), but It failed to set the focus to the windows too. what to do?
Joseph Marzbani
Posts
-
How to set keyboard focus to the other windows in the z-order? -
ofstream can't write a "double" value into a file correctlythank you for your attention! 1. is that a STANDARD method or Implementation-Specific? (Yes I know I've already asked it. Just for sure) 2. What's that padding stfuff useful for? Why do compilers take such a strategy?
-
ofstream can't write a "double" value into a file correctlyyou're right (and I'm left :) but I meant "the sum of all memberss' size" when I said "the size of a structure". by the way do u know how I can make the compiler ignore that PADDING stuff? I mean a STANDARD way not an implementation-specific one. thnx
modified on Wednesday, August 18, 2010 11:24 PM
-
ofstream can't write a "double" value into a file correctlycongratulations! You're life's so meaningful :) cause I'd behaved so stupid!!! I was wrong and my compiler had emitted a warning too. and one more thing! thnx 4 introducing that modern compilet.
-
ofstream can't write a "double" value into a file correctlythat code was what I got in real! by the way, did you mean I can rely on "sizeof" to write/read a whole structure into a file aborting that "padding" stuff? like when I don't know how it works under the hood
-
ofstream can't write a "double" value into a file correctlythank you! It was really helpful
-
ofstream can't write a "double" value into a file correctlyThank you! but one expects to get whatever he's saved on a file as the original value. I'll read that article for sure. but for now could you explain what should I do to save and retrive a "double" value. a short exam will be appreciated.
-
ofstream can't write a "double" value into a file correctlyI've a structure like this:
struct STRUCT { bool b; int i; double d; }str; // initializing str.b = true; str.i = 18; str.d = 20
and because I know I can't get the real size of a structure using operator sizeof, I write it into a file in this way:wofstream of("FileName.dat", ios:out
of.write(reinterprete_cast <char*> (&str.b), sizeof(bool));
of.write(reinterprete_cast <char*> (&str.i), sizeof(int));
of.write(reinterprete_cast <char*> (&str.d), sizeof(double));and finally when I read it again into "str" and display it using cout, I got this values: str.b = true; str.i = 18; str.d = 20.001 why 20.001 instead of 20 is written? I took a look into the file using a HEX-Editor and I saw 20.001!!!
-
what is "wofstream" useful for?!!thank you so much. :rose: for you :)
-
what is "wofstream" useful for?!!no, don't get it wrong. in my case, when I have such a line as
of << L"فارسی";
It does not write ANY THING AT ALL into the file. strange, ha? -
what is "wofstream" useful for?!!no I have not, and thank you for your clue. I'll read it as soon as return back my home. and one more thing, could you please show me some more resources on these new things (STL::locals). I've no previous experience on that.
-
what is "wofstream" useful for?!!yes I have. to be more clear, this damn class writes ASCII characters quiet well. the problem I have is about non-English characters.
wofstream of (L"FileName.txt"); of << L"English"; // this works of << L"فارسی"; // this does NOT work of.close();
-
what is "wofstream" useful for?!!no it's not! it just creates an empty file. I've tried it 10's times.
-
what is "wofstream" useful for?!!as I've heard, the class wofstream narrows every thing when it writes to a file. that is it converts every wide character to a single byte one and then writes it to the file. in this way you can't have such a thing as:
wofstream out(L"foo.txt"); out << L"unicode string";
so there is one question: what's this WIDE class useful for?!! how you name it WIDE version of "ofstream" while it can't be used with wide characters? and one more thing: why it takes a parameter of type char* as the file name? it's a wide class any way :) -
what are these process with user name SYSTEMI know it's a little more than a little funny :) but I don't know how some process have the user name SYSTEM within the window task manager while they are not a system process. E.g some anti viruses and ...
-
how to write a function in a file at binary level (after compilation)because I need to write it anywhere I want. I don't want to use the simple copy-paste method.
-
how to write a function in a file at binary level (after compilation)I know this may look a little more than a little strange! But for a reason I want to write a whole function in a file at run-time. OK, let's do some clarification: see you have a function like:
void foo ()
{
your code ...
}after compilation we have some thing like:
// foo()
push 210
mov eax, ebx
...and in binary level:
// foo()
E8 00 DA 65 00 00 DF
What I need is to write these binary codes in a file. Note 1- There's no such an instruction like
mov eax, eip
orpop eip
in Intel instruction set. Actually there's no instruction to get or set eip directlt.Thank you masters!
-
How to get the parent proccess's pathI want to run an application (see child) so that it can get the path of the current process (see parent). How?
Thank you masters!
-
File browser control in MFCWhy don't you just use CFileDialog class?
Thank you masters!
-
How to find out if a pe file has been packed?Hi masters! I'v written a code by which I can add a new section to pe files. But as I've noticed, some pe files are a little more intelligent than I thought :) Because as soon as I run them after I add the new section, a message says to me that this file has been modified! Even when I change a few first opCode begining at their entry point without add any section to them and without making any other change to them, the same message appears! Do you think they're "packed"? How can I find out? How can I find the original entry point?
Thank you masters!