|
panda08 wrote: The incomplete code bellow.... If you completed, would it then work?
panda08 wrote: The incomplete code bellow doesnt seem to be working... Was it intentional that you failed to explain what it is (not) supposed to do?
panda08 wrote: ...as intended. What is its intent?
The onus is on you to pare down your code to just that which is problematic; not ours to wade through a bunch of code to try and figure out what it is supposed to do and why it is not doing such.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Hi
I have been trying to write to the non client area of a window specifically a Cdialog
This CDialog has a Rich Edit (I am displaying storage obtained) and I am trying to give details about it in the Non client area
seems to me there are 3 choices if I want to make it look nice nice means using the CDC class
1) process the ON_WM_NcPaint 2) using windows desktop manager (extending the frame and making it the client area) 3) using a static control / window
was wondering if someone could guide on which path to take
thanks
|
|
|
|
|
ForNow wrote: This CDialog has a Rich Edit (I am displaying storage obtained) and I am trying to give details about it in the Non client area
What kind of "details" are you gong to give in the dialog titlebar ("Non client area")? And why the simple SetWindowText call could not help you?
Or did you mean some other area (not a titlebar - ?) to put your details?
|
|
|
|
|
I am displaying MainFrame storage sent via TCP/IP sockets to Windows so the rich edit would display the actual storage
The data in the NC frame of the dialog would be the storage subpool where the storage was obtained, the storage key, whether the storage fetch protect (non readable) owning tcb in z/os resources are owned by the task represented by a tcb control that have programs represented by RB (request blocks)
as anside one of the things I learned that in windows that are only process and threads
thanks
|
|
|
|
|
ForNow wrote: I am displaying MainFrame storage sent via TCP/IP sockets to Windows so the rich edit would display the actual storage
In the context of your question it doesn't matter where the data you are going to display is coming form and how.
however, you didn't answer why the simple SetWindowText cannot be used nor did you described the format of the data to be desplayed in NC area.
|
|
|
|
|
let me preface this by saying I am basically a mainfame programer so then I appreciate your expertise so here goes
SetTextWindow gives me one line to fill out with no choice for color background color or font
If I for instance use an ownerdraw static window my OnDrawitem could handle an rcItem Rect with possibly multiple lines allowing me to have my own font and color ?
|
|
|
|
|
Then what does prevent you to implement some user defined control (derived from CStatic or, better, from CWnd), place it above or below your RichEdit and draw what you want using CDC class in this control?
Just try it! Then if you wouldn't happy with such implementation then your next step were to move the code to the OnNcPaint handler.
|
|
|
|
|
thanks BTW I spent hours and hours with NCPAINT is doesnt work after getting the right DC GetWindowDC did a Textout pos 1,1 and text was never displayed
anyway thanks for your help much appreciate it
|
|
|
|
|
Make sure you are using the correct DC. Windows loves to clip stuff when drawing.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
I did a quick searchereno using what we use, Lucene.net, and it's query syntax, and obtained:
XFontDialog - Customizing CFontDialog Part I: Adding Font Filters[^]
If you scroll down to the end of the page where the last image is perfunctorily displayed perhaps you'll see what I saw and think Is this what a non-client area customization looks like?
|
|
|
|
|
|
No offense to you youngsters...
I'm looking for someone or people who have scars from activeX development. Yes, I know it's obsolete, but unknown to most of you the world runs on existing code.
Rather than pollute the forum, you can find me at cgilley2640@gmail.com.
This is a cash opportunity - I'm stuck. Email me and I'll give you the particulars.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
|
Because it's all written in C++? I'll move it.
Also, I did not realize the discussion board list had multiple levels. Just learned something new.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
happily, after dancing with this for many years, I have resolved my bug. As in most cases, it was a series of cascading failures, but ultimately, it came down to an arcane threading issue in COM.
Of course, the error message was "failed to load control, is it properly registered?" which had nothing to do with the real problem.
Happy to have this monkey off my back.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Hi
I got a link error
error LNK2019: unresolved external symbol __imp_DwmExtendFrameIntoClientArea referencing this API
DwmExtendFrameIntoClientArea
I did include in my VS property pages Linker->general-> input dwmapi.lib tried to open it (the dwmapi.lib) with depedency Walker got no DOS or PE signature. I opened dwmapi.dll from windows\system32 and saw the API thru dependency walker inluded dwmapi.h in the source. The Doc has Dwmapi with a capitol D but both .lib and the dll had small d
Any help appreciated thanks
|
|
|
|
|
|
Richard I changed it in the release Property Pages added dwmapi.lib but I did a debug build
got a clean link now
thanks
|
|
|
|
|
Oh yes, yet another one of Microsoft's 'Easter Eggs' left for us to trip over.
|
|
|
|
|
Hi I am trying to write a caption to my modeless dialog box I did a getwindowrect and screen to client as the negative "y" coordinates would be where I would want to place my text
did dc->Setcolor to blue got my text extents from CDC When I did a dc->textout nothing happened
I also noticed Cwnd has DrawCaption but doesnt take a parameter for Text. DrawText however has a DT_TEXT flag but where does it pick up the text
Can you write a caption using a device context
Thanks
|
|
|
|
|
It sounds like you are trying to write in the title bar of the window - is that right? The easy way is to call SetWindowText() on the dialog box HWND (or do whatever the MFC equivalent is) and let the default dialog proc handle drawing your text.
Otherwise you would have to draw in the non-client area, which has its own WM_NCPAINT message to handle.
|
|
|
|
|
thanks I choose the later NC_CLIENT might I ask you a few follow up questions 1) is there a way to determine the NC area,like GetWindowNCRect. In Additon TextOut is giving me issues would I be better off using DrawText would it need to be preceded by DrawCaption
Not sure as
if you could steer me the right direction would appreciate it
|
|
|
|
|
WriteFile return access denied?
while i providing admin privileges
please help me for this.
HANDLE hCD = CreateFile (file_Name, GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);
WriteFile (hCD, Buffer, Size, &bytesWritten, NULL);
its fails with access denied.
thanks in advance.
|
|
|
|
|
Check the file name and make sure that it is where you think it is, and is not protected against write access.
|
|
|
|
|
i chk all is ok n its not write protected at all....
now what can i do
|
|
|
|