|
I would like to create a framebuffer in various custom 16bit formats and then display this with win32.
How is this best done ? I really need a direct pointer to modify the pixel data in my own custom format.
Thx
|
|
|
|
|
I think using DirectX would be your best bet.
Steve
|
|
|
|
|
Do you happen to know where I can find specific sample code for this ?
Thx
|
|
|
|
|
Not off hand - But it's a popular subject. If you do a searce on Google and The Code Project you'll find lots of information.
Steve
|
|
|
|
|
hey guys, i need a litte bit help.
How to make that my app checks the windows-status of another app for example Iexplorer.exe.
I need to get results of iexplorer, is it infront(active; is it used right now?) of all applications or is it in the back(like minimized or something..
Thanks for your thinking
|
|
|
|
|
Are you looking for things like:
IsWindowEnabled()
IsWindowVisible()
IsIconic()
GetTopWindow() (compare return value to IE's window handle)
"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
|
|
|
|
|
hey thanks, I dont know how to use is but sounds good, ill try
|
|
|
|
|
Hallo.
I've created an activeX control, now I need to put this control on a dialog. It seem's easy, but I need to creat a dll library where are two functions Start(CRect rect,CWnd pParentWnd) and CloseShow(). A dialog has a button and when you click it it calls Start(CRect,CWnd). I've spent a lot of on that. Help me if you can.
|
|
|
|
|
How you host an ActiveX control would depend on when libraries you're using - ATL, MFC, etc.
Steve
|
|
|
|
|
|
In MSVC6:
1. "Project->Add To Project->Components and Controls..."
2. Open "Registered ActiveX Controls" folder.
3. Pick control.
4. Click "Insert".
5. Press "OK".
6. Press "Close".
An icon for the new control will appear on the dialog editors controls toolbar. Proceed as you would for other dialog controls.
Steve
|
|
|
|
|
Thanks, but the problame is not in that.
I've connected the ActiveX, showed it on my parent CWnd, but when I create it
CWnd * m_chiled;// is in header
m_chiled = new MyContral();
I have memory leak, I need to alloc memory for veriables of DLL.
|
|
|
|
|
I'm using straight Win32 API, no MFC.
I've set up a custom control in a dialog app.
It receives WM_KEYDOWN/UP events just fine.
I can tab to it, but it doesn't "show focus".
The actual drawing of the control as focused is easy,
but HOW to I correctly respond to these focus messages???
Any example code around?
Also, although I can tab into the control and tab out of it,
clicking it with the mouse DOESN'T move keyboard focus to it.
(no WM_KEYDOWN/UP events after clicking it's area w mouse.)
Any help?
Thanks in advance!
...Steve
|
|
|
|
|
Steve Hazel wrote: The actual drawing of the control as focused is easy,
but HOW to I correctly respond to these focus messages???
most of the buttons i've done just check the flags in the DRAWITEMSTRUCT they get in their DrawItem handler and draw as focused if necessary (ie. if (pDIS->itemState & ODS_FOCUS) != 0).
you don't need to track key presses or anything like that - Windows will keep track of which control has focus. the control just draws itself accordingly, with the flags Windows hands it.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Well, thanks for answering. But I'm not using a button control, i'm using a custom control.
A DRAWITEMSTRUCT only comes to you in a WM_DRAWITEM message.
(an owner drawn button, etc).
Let me back up and explain my problem better.
I'm trying to capture WM_KEYDOWN and WM_KEYUP events in my dialog app - a midi sequencer.
I'm going to use keydown/up to make the keyboard behave "sorta like" a midi keyboard.
(synthesizer keyboard).
So I have a custom control (window class of KBD) that captures WM_KEYDOWN/UP just fine.
But it doesn't show any focus rectangle, etc.
I need to know WHEN to display the thing as focused and when not.
Also, I need for the thing to be focused when clicked on in addition to
when tabbed to. Tabbing to it works fine. Clicking on it doesn't give
it focus...
Any ideers?
also, I tried using a subclassed (WinProc over-ridden) static control marked w
WS_TABSTOP (or whatever) and didn't get keypresses in it.
Will a button control pass along WM_KEYDOWN/UP messages?
Or any other type of control?
Thanks for givin it a shot
...Steve
-- modified at 16:30 Thursday 19th January, 2006
|
|
|
|
|
You need to respond to the WM_SETFOCUS and WM_KILLFOCUS messages.
Steve
|
|
|
|
|
Thanks
I just figured that out.
But how do I make the thing get focus when it's clicked on with the mouse?
...Steve
|
|
|
|
|
You could try calling SetFocus in your WM_LBUTTONDOWN handler. Before this I'd make sure you're passing these messages to the DefWindowProc - It may take these steps for you (I'm not sure).
Steve
|
|
|
|
|
THANKS!
That did it!
I'd been expecting that dang DefWindowProc to do this...
I mean, it does it for keydown (or something) so why not mousedown???
Oh well. It works and I'm off to make the thing DO somethin now
THANKYOUUUUUUUUUUUUUUUUUUUUUU !!!
...Steve
|
|
|
|
|
Hi, sorry in advance to those who may find this a dumb question.
I have the peak values of a wave file displayed in a frame in my dialog box. I want to have a line running across the waveform when the file is playing. I'm thinking that it's quite a hassle to have to use GDI to draw a line at a particular point, then erase and redraw at another point at every seconds of playback. While thinking of ways to avoid the trouble of having to call SetROP2 so many times, I thought of using a caret.
Question: Is a caret even possible in such a situation?
|
|
|
|
|
Well, this won't be much help, but if you can do it, it's possible
I guess the prob with drawing the line is undrawing it, eh?
SetROp (hdc, R2_NOTXORPEN); // <-- YOUR FRIEND
If you go with the caret approach, you'll either have to use the same SetROp xor
biz or else reserve room for the caret in your (probably) custom control...
In any case, it's not the drawing, it's WHEN to undraw that's the tricky part.
If you figure it out, lemme know...
I've got an app doing the same thing and occasionally it doesn't "undraw"...
...Steve
|
|
|
|
|
I have some code that renders multiple lines of text using a mono-spaced font (like Courier New, or Lucida Sans Typewriter).
The UI draws the text in an area of no more than 24 lines by 80 characters wide.
The font to draw this text is calculated so that it fills up as much of the current view rect as possible, so resizing the window causes the font size to get larger or smaller.
In Win2K I can resize the window such that there is no extra space at the edges, and on my machine in XP I can also do this. However on several of my users machines, in XP, they cannot do this, resizing will always cause the font size to jump up or down such that there's space left over at the edges.
I'm using the CDC::GetTextMetrics to get the font/text sizes.
Why would I see different text performance, using the same font name/family between Win2K and even between XP installs?
All versions of XP are identical in terms of the build/sp number (as reported by running the "winver" command).
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
I have noticed different font sizing (exactly the same face and point size) due to XP's ClearType being turned on or off. It seems that ClearType tends to render the font smaller than old W2K without ClearType.
onwards and upwards...
|
|
|
|
|
Yeah I thought that might be the case too. So I checked this in the Display options and tried with it turned on and turned off. It made no difference on my machine at all.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
You may want to use GetCharABCWidths to calculate the sizing for the width. Also, are you subtracting any scrollbar area, borders or 3D bevel edge sizes (GetSystemMetrics())? These can be different with the new XP themes.
onwards and upwards...
|
|
|
|