|
hi all
i set up a right to left menu in my language for my application. but the items are not right aligned. it seems to be a bug in calculation of their widths:
http://home.morva.net/hamidi/menu-ye_kharab.gif
because when i use a fixed width font for menus in Appearance section of Desktop Properties, the problem gets fixed.
anyone has an idea or knows a workaround?
thanx
|
|
|
|
|
Hi
i am calling the open file dialog in my program
if (GetOpenFileName(&ofn)==TRUE)
hf = CreateFile(ofn.lpstrFile, GENERIC_READ,
0, (LPSECURITY_ATTRIBUTES) NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
(HANDLE) NULL);
however,when it displays it is placed in the top left of the screen
and not in the middle
can any1 help
thanks
si
|
|
|
|
|
Did you specify the HWND hwndOwner? in the ofn?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Papa wrote:
Did you specify the HWND hwndOwner? in the ofn?
i have declared
HWND hwnd;
ofn.hwndOwner = hwnd;
but get a runtime error, when it executes
|
|
|
|
|
you should specify the hwnd of your window
How are you creating your window?
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
<small><b>Papa wrote:</b></small>
<i>you should specify the hwnd of your window</i>
eh ??? in english please
im delcaring it how it is in msdn
OPENFILENAME ofn; // common dialog box structure
char szFile[260]; // buffer for file name
HWND hwnd; // owner window
HANDLE hf; // file handle
// Initialize OPENFILENAME
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
// ofn.hwndOwner = hwnd;
ofn.lpstrFile = szFile;
//
// Set lpstrFile[0] to '\0' so that GetOpenFileName does not
// use the contents of szFile to initialize itself.
//
ofn.lpstrTitle="Select CMIS Student Datafile";
ofn.lpstrFile[0] = '\0';
ofn.nMaxFile = sizeof(szFile);
ofn.lpstrFilter = "Microsoft Access Files\0*.mdb\0All\0*.*\0";
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
// Display the Open dialog box.
if (GetOpenFileName(&ofn)==TRUE)
hf = CreateFile(ofn.lpstrFile, GENERIC_READ,
0, (LPSECURITY_ATTRIBUTES) NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
(HANDLE) NULL);
|
|
|
|
|
Let me reformulate the question:
You are creating an application.
Are you using Direct Win32(CreateWindow) or MFC?
In either cases:
Win32 :
hwnd = CreateWindow(...
ofn.hwndOwner = hwnd;
MFC :
CWnd* pWnd = AfxGetMainWnd( );
if(pWnd)
ofn.hwndOwner = pWnd->m_hWnd;
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
|
si_69 wrote:
HWND hwnd;
ofn.hwndOwner = hwnd;
but get a runtime error, when it executes
Because hwnd is not a valid window handle.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Where can I find a sample or documentation on ActiveX controls for use from MSAccess Forms.
I am trying to create an activex contol (SysListView32 derived) and trying figure what interfaces should I implement to bind it properly, provide a datasource for the items, etc.
Thanks in advance.
...Plug & Pray...
|
|
|
|
|
how to set the color of theme bar?in addition,how to simply set the button color?is there a simple way to know the practical display color that RGB represents?
|
|
|
|
|
Hi friends,
Currently i am developing one graphical application. The drawing tools like Rectangle, Ellipse, Freehand are kept in a toolbar. My intention is to display the toolbar whenever the user move the mouse to top zone of the client area and hide the toolbar whenever the user move the mouse away from the topzone. I constructed toolbar using Dialog Bar. But i don't know how to place the Dialog Bar in the view window.
Please help me regarding this.
Regards,
Prakash
A Journey of thousand miles must begin with a single step.
|
|
|
|
|
How can i get & set folder acess permission under NTFS file system?
Hello World
|
|
|
|
|
Try
http://www.sysinternals.com/ntw2k/source/accessenum.shtml
Sonork 100.41263:Anthony_Yio
Life is about experiencing ...
|
|
|
|
|
Pls Explain what are network patches?
How do they occur?
Explain this with agood example.
|
|
|
|
|
Pls Explain what are network patches?
How do they occur?
Explain this with agood example.
AND 3 WORKER THREADS.PLS LET ME HOW TO EXCHANGE THE DATA BETWEEN THESE 3 WORKER THREADS.
FOR EX:THE FIRST THREAD WILL GIVE THE SECOND THREAD THE 2 NUMBERS AS ARGUEMENTS.the second thread should return the first thread the sum.
Pls help
|
|
|
|
|
ykutanoor wrote:
Pls Explain what are network patches?
I've never heard the term network patches before. In the general sense, a patch is a piece of code added to software in order to fix a bug (between two releases). You've no doubt heard of an OS patch, which could include, among other things, fixes for network-related components.
ykutanoor wrote:
AND 3 WORKER THREADS.PLS LET ME HOW TO EXCHANGE THE DATA BETWEEN THESE 3 WORKER THREADS.
FOR EX:THE FIRST THREAD WILL GIVE THE SECOND THREAD THE 2 NUMBERS AS ARGUEMENTS.the second thread should return the first thread the sum.
So what does the third thread do? In any case, I would be inclined to use PostMessage() for communication between them.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I have a dialog with about 15 edit controls.
The controls are a subclass I've made of CEdit , CMyEdit for the matter.
2 out of the 15 CMyEdit controls don't have their OnNcPaint override called, for no apparent reason. all edit-boxes are declared the same way in the resource-editor, no special handling of any of them not in resources nor in code.
I've tried overriding OnCreate , OnNcCreate (added ON_WM_XXX ofcourse) and Create itself but none of them are ever called.
What am I missing out ?
p.s. - what I need is a 'point of intervention' during the creation/post-creation of the edit-control during which the control is already sized and positioned correctly.
|
|
|
|
|
ohadp wrote:
2 out of the 15 CMyEdit controls don't have their OnNcPaint override called, for no
You have most probably made some silly error. Check and recheck! You will want to make sure they are attached to the correct kind of variable in the h-file, and that the resource IDs don't clash.
ohadp wrote:
p.s. - what I need is a 'point of intervention' during the creation/post-creation of the edit-control during which the control is already sized and positioned correctly.
Perhaps PreSubclassWindow ?
|
|
|
|
|
I've checked all the resource-ids/etc, all looks ok.
PreSubclassWindow is interesting but problematic. The reason is that if I do my things inside
PreSubclassWindow<code> my control isn't subclassed yet, and so it's message-handlers aren't called when messages arrive :-)<br />
<br />
So I'll a little condition to the situation I was persuing earlier. What I need is an intervention-point during which the control is sized, and subclassed. Something like <code>PostSubclass , or PostCreate , or anything of that kind
|
|
|
|
|
ohadp wrote:
I've checked all the resource-ids/etc, all looks ok.
Then, you might want to tear down the project, perhaps by removing all the controls that works. Set a breakpoint in some function you know will be called in the class of the offending controls (such as PreSubclassWindow ) and verify that the controls are really subclassed.
ohadp wrote:
PreSubclassWindow is interesting but problematic. The reason is that if I do my things inside PreSubclassWindow my control isn't subclassed yet, and so it's message-handlers aren't called when messages arrive
To be sure I've not gone completely crazy (which I still won't outrule, however), I tested with a subclassed CEdit , instantiated from a resource template, mapped to a control variable of my class.
As expected, PreSubclassWindow is called after the control is created, and so you do have access to the control size and position. Of course, the handlers of the subclass aren't called before or during this call, thus the name PreSubclassWindow
Now, as PreSubclassWindow is a member of your class, you have full access to all other class members of the instance at this time of the execution, so I'm slightly baffled as to why you would need to know that the subclassing is finished - for all practical purposes, it is at this stage.
|
|
|
|
|
The deal is that during initialization, I want to trigger my version of OnWindowPosChanging .
I can fake a direct call to it from PreSubclassWindow , yes, but it's a little unorthodox so I was looking for a cleaner way to do it.
I guess that's just what I'll do then, thanks for the tips.
|
|
|
|
|
If you want a slightly cleaner architecture, put the code in a separate function and call it from both OnWindowPosChanging and PreSubclassWindow .
|
|
|
|
|
Hello Guy's,
I have in great trouble, i'm working for a image procssing project and i want to increase a pixel intensity if a perticular condition satisfies..
I have to copies of a same image only the RGB values as an BYTE array and the BITMAPINFO structure corresponding to that image. Then take each pixel of both image and compare the blue component and if the difference of the blue component is > some constant say 25 i have to increase the intensity of the new image: ... problem is i have only RGB values ... 3-BYTE for represent the pixel...
Any idea to do this.
pls help me
Thanks in advance.
Anurag Velekkattu
|
|
|
|
|
BYTE GetBValue(
DWORD rgb // RGB value
);
Hope this will help you.
|
|
|
|