|
hi~everyone
i hava a question puzzle me ! when i used "CreateDirectory" function make a file use unicode in windows 98
but it's allways fail !
please help me ande very thanks in advance!!
nothing
|
|
|
|
|
as far as i know, unicode support in win98 is not too good and unicode apis are not well documented.
-Prakash
|
|
|
|
|
You need MLU[^] to work with Unicode in 98 Machine :->.
Regards,
Aljechin Alexander.
|
|
|
|
|
ebinaini wrote: ...but it's allways fail !
What does GetLastError() return?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
HI,
I use this code to creat a windown. I want to know there way to make sure it is always on the top of the other windows of others application. Can I anyone send me a pointer?
// Create a main window for this application instance.
hWnd = CreateWindow(
"SWClass",
"M App.",
WS_OVERLAPPEDWINDOW, // Window style.
1000, // Default horizontal position.
000, // Default vertical position.
280, // Default width.
100, // Default height.
NULL, // Overlapped windows have no parent.
NULL, // Use the window class menu.
g_hInst, // This instance owns this window.
NULL // Pointer not needed.
);
Jim
-- modified at 19:40 Tuesday 24th January, 2006
|
|
|
|
|
Use the SetWindowPos API function on your hWnd.
Take a look in MSDN about how to use it. Or maybe this is enough, I took it for you:
BOOL SetWindowPos( HWND hWnd,
HWND hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
UINT uFlags
);
Put hWndInsertAfter = "HWND_TOPMOST" and then at uFlags SWP_NOMOVE and SWP_NOSIZE and SWP_NOACTIVATE, depending on what exactly you wish to do. More details about all those in MSDN :- D.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Axonn Echysttas,
Thank you so much for a quick reply. Another quick question, if I want to dock my window in the top-right conner of the screen, what enum should i use? Sorry for my novie quesiton since i am kind of new to this windows programing thing.
Thank again.
Jimmy
Jim
|
|
|
|
|
You can't dock it there. You must use some dynamic positioning. It's easy. Grab screen dimensions using GetSystemMetrics(SM_CXSCREEN) and GetSystemMetrics(SM_CYSCREEN). Those will return X/Y sizes in pixels. Then make some simple arithmetic calculations to determine where your window's X should be so that it's X + WIDTH reach the screen total X : ).
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
hi there,
Work like a charm...thank a bunch!!!!!!!!!!!
Jim
Jim
|
|
|
|
|
You're most welcomed : ).
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Hi, all,
Let's say math is not my strong subject.
That said, can anyone explain to me how to pack a floating point value into a 4 byte char array?
Any help would be much appreciated.
Thanks in advance.
|
|
|
|
|
You should use a union.
union FloatConverter
{
float fValue;
char Bytes[4];
};
|
|
|
|
|
Thanks for the info.
What I was actually looking for is something along the lines of char bytes[4] = float.
or possibly send it to a memory file and read back into a character array. I just have no clue as to how it should be done.
|
|
|
|
|
P1P3R wrote: What I was actually looking for is something along the lines of char bytes[4] = float.
A union will do this. It's actually quite simple. Each member in the union occupies the same memory space. So anything you put into the float will show up in the char array. Anything you put into the char array will effect the float.
union FloatConverter
{
float fValue;
char Bytes[4];
};
void Test()
{
FloatConverter converter;
converter.fValue = 1.23;
char floatByte0 = converter.Bytes[0];
char floatByte1 = converter.Bytes[1];
char floatByte2 = converter.Bytes[2];
char floatByte3 = converter.Bytes[3];
}
|
|
|
|
|
I did not know this. Will give it try.
many thanks.
|
|
|
|
|
Hm... I got a weird weird problem. I subclassed the Systray Clock window but the WM_LBUTTONDOWN message ain't comming through my window procedure, the one I subclassed it to. This is really something 'cause subclassing is meant to direct ALL messages to me, but that message simply ... doesn't get here. What could be wrong?? I receive other messages as WM_PAINT and the subclassing is perfect since I already use it for other purposes.
Could this be a hint?
SetClassLong(pcwps->hwnd, GCL_STYLE, GetClassLong(hwndSystrayClockWindow, GCL_STYLE) & ~CS_DBLCLKS)
What does "& ~" do anyway? I haven't been programming in C++ for such a long time and I am unfamiliar with that construction. Is it meant to subtract an attribute from that window's Class Bits?
Pffff... weird stuff goin' on here... ::- |.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Hi,
the "& ~" construction means to remove the class style CS_DBLCLKS from the window. But this isn't necessarily the source of your problem. MSDN says the following:
>> If a window does not have the CS_DBLCLKS style, Windows sends
the following message sequence to the window: WM_LBUTTONDOWN,
WM_LBUTTONUP, WM_LBUTTONDOWN, and WM_LBUTTONUP.
>> If a window does have the CS_DBLCLKS style, Windows sends the
following message sequence: WM_LBUTTONDOWN, WM_LBUTTONUP,
WM_LBUTTONDBLCLK, and WM_LBUTTONUP. That is, the second
WM_LBUTTONDOWN message is replaced by a WM_LBUTTONDBLCLK
message.
So I guess the problem is located somewhere else.
regards,
mykel
If they give you lined paper, write the other way!
|
|
|
|
|
Yeah, I read the MSDN too... pretty friggin strange. Thanks for the explanation about & ~.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Beah this sucks and it's stupid. I can't beleive it. I just don't get those messages. Beah. I'm gonna put myself a hook there and story over. Nobody messes with hooks anyway, they rule. I don't like loading the system but a tiny HH_MOUSE on explorer.exe won't kill anybody :- D.
It's 3:18 AM and nobody answers... so I'll just do it like this since in about 12 hours I gotta release this stuff I'm working at. I'll check this topic after that... maybe some wise guy here has a clue why those stupid messages don't get in the WndProc that I made for the Systray Clock.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
When the WM_NCHITTEST message (which always precedes the other mouse messages) is sent to the clock window, it returns the value HTTRANSPARENT, causing Windows to send the message to its parent, a window of class "TrayNotifyWnd". This also returns HTTRANSPARENT, so the message is sent to its parent, a window of class "Shell_TrayWnd". This window returns HTBORDER, indicating a click in the non-client area, so Windows then sends a WM_NCLBUTTONDOWN to the Shell_TrayWnd window - the child windows are treated as being transparent and do not receive the mouse click messages. The Shell_TrayWnd window is the one that actually receives and processes the mouse click messages.
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"
|
|
|
|
|
Hi Ryan : ). Actually, I got that one subclassed too and I don't get nothing there either, beleive it or not. I solved my stuff with a mouse hook over explorer.exe but this isn't a solution I would accept if I would have alternatives. Unfortunately, I don't. Is it possible to make the TrayClockWClass accept mouse events?? Possibly chaning its class style ???? I don't know...
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Are you checking for WM_NCLBUTTONDOWN messages? You won't get WM_LBUTTONDOWN messages because the clock window is setup to be in the non-client area of the tray window.
You could make the clock accept mouse events by overriding WM_NCHITTEST and return HTCLIENT from it, except then its standard functionality would not work.
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"
|
|
|
|
|
I ain't getting no messages. Here's my check:
LRESULT CALLBACK WndProcTaskBar (HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam)<br />
{<br />
switch (wParam)
{ <br />
case WM_LBUTTONDOWN:<br />
case WM_LBUTTONUP:<br />
case WM_LBUTTONDBLCLK:<br />
case WM_NCLBUTTONDOWN:<br />
case WM_NCLBUTTONUP:<br />
..........
TaskBar being, of course, Shell_TrayWnd. Oh well, I guess I can play around with WM_NCHITTEST... thanks for the help once again, this ain't the first time you helped me :- ).
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Just out of interest, what's your default case doing? Is it calling DefWindowProc() or CallWindowProc() with the previous (unsubclassed) window procedure? It should be doing the latter if you want to retain functionality.
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"
-- modified at 4:21 Wednesday 25th January, 2006
|
|
|
|
|
All my cases (Systray Clock, TaskBar, Systray Window) are CallWindowProc with the handle returned when I subclassed via SetWindowLong....
Hm, as far as I see the hook isn't even as good as I thought. It has a few minor problems. But if I have no choice I'll keep it. I think I will soon try that HTCLIENT thingy that you mentioned. But right now I can't 'cause I gotta release on my head and just a few more hours to deliver it. (it's the second Beta of the freeware application I'm working on and I'm giving it to some more friends to use and report bugs ::- D ).
-= E C H Y S T T A S =-
The Greater Mind Balance
-- modified at 6:19 Wednesday 25th January, 2006
|
|
|
|