|
kumar_windows wrote: may be this problem is arising because of the code i have written for the FONT
Why didn't you try to comment out this code and try?
Actually what you got is the basic behaviour.
I would like to handle this problem in PreTranslateMessage of the dialog...
- NS -
|
|
|
|
|
Pls make the "Disabled" property of Edit control TRUE. Then it will not get selected.
Praveen
Akkott
|
|
|
|
|
thank you very much
thanx in advance
kumar_windows
|
|
|
|
|
Hi,
I have the below code in my app for showing a menu on right click on a systray icon.
CMenu SystrayMenu;
CPoint pt;
GetCursorPos(&pt);
SystrayMenu.CreatePopupMenu();
SystrayMenu.LoadMenuW(IDR_MENUSYSTRAY);
SystrayMenu.TrackPopupMenu(TPM_BOTTOMALIGN|TPM_LEFTBUTTON,pt.x,pt.y,this,0);
The menu appears on right click, but I only get a narrow bar.
In the menu resource I have one item "Exit", but nothing is shown.
What could be the problem ?
- KK
|
|
|
|
|
there is small problem in ur code. Modify it as below
CMenu SystrayMenu;
CPoint pt;
GetCursorPos(&pt);
SystrayMenu.CreatePopupMenu();
SystrayMenu.LoadMenuW(IDR_MENUSYSTRAY);
SystrayMenu.GetSubMenu(0)->TrackPopupMenu(TPM_BOTTOMALIGN|TPM_LEFTBUTTON,pt.x,pt.y,this,0);
nave
|
|
|
|
|
I get an access violation error when I do that.
- KK
|
|
|
|
|
plz ensure that the menu have submenus.
make a menuu of below structure( similar to a file menu in notepad ) and try
File
Open
Close
nave
|
|
|
|
|
I got it working. Thank you.
What I wanted is just one "EXIT" to be present in the right click menu.
So I just had EXIT in top most menu.
Then I added another item Exit in it's submenu and it works, shows only the submenu.
thanks again.
- KK
|
|
|
|
|
Hello comunity,
when i create an new file(CStdioFile) and write something in them i close it with CStdioFile::Close();,
but how to set the attribute FILE_ATTRIBUTE_READONLY to avoid that someone make changes at random,
my program need this file after create to work with them, and when is inside the file something
wrong my program want crash!
regards
break;
|
|
|
|
|
If I understood u right, you dont want another process to access the file when ur program is using it, to do this use CFile::shareExclusive with the Open operation.
if u open a file while in read-only, u cant write in it unless u clear this attribute, so that ur program crashes.
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Im not sure I understand all you're saying but :-
assuming : - LPCTSTR lpFileName
DWORD dwFileAttributes = GetFileAttributes( lpFileName);
long mask = dwFileAttributes;
if( ! ( dwFileAttributes & FILE_ATTRIBUTE_READONLY))
{
mask = dwFileAttributes | FILE_ATTRIBUTE_READONLY;
if( ! SetFileAttributes( lpFileName, mask))
{
// Flag the error here
return;
}
}
is probably what you're looking for - your program would of course have to remove the readonly flag before it used the file - the suggestion above this is also valid (ie exclusive flag)
'g'
|
|
|
|
|
Hello Garth,
yes, this is that what im looking for!
but need some help again!
Please check this code:
<br />
DWORD dwFileAttributes;<br />
DWORD mask;<br />
<br />
dwFileAttributes = GetFileAttributes(csFileName);
mask = dwFileAttributes;<br />
<br />
if((dwFileAttributes & FILE_ATTRIBUTE_READONLY))<br />
{<br />
mask = dwFileAttributes & FILE_ATTRIBUTE_NORMAL;
if(!SetFileAttribute(csFileName, mask))<br />
{<br />
AfxMessage(csErrorMessage);<br />
}<br />
}<br />
<br />
cMyFile.Open(...);<br />
dwFileAttributes = GetFileAttributes(csFileName);
mask = dwFileAttributes;<br />
if(!(dwFileAttributes & FILE_ATTRIBUTE_READONLY))<br />
{<br />
mask = dwFileAttributes | FILE_ATTRIBUTE_READONLY;
if(!SetFileAttributes(csFileName, mask))<br />
{<br />
}<br />
}<br />
This is what im doing with your response!
Is this right, take a look to my sample please!
Maybe is not the best way, but they do wat i want!
with best regards
break;
|
|
|
|
|
I would have done :-
DWORD dwFileAttributes = GetFileAttributes( lpFileName);
long mask = dwFileAttributes;
if( dwFileAttributes & FILE_ATTRIBUTE_READONLY)
{
long mask = dwFileAttributes & (~FILE_ATTRIBUTE_READONLY);
if( ! SetFileAttributes( lpFileName, mask))
{
// Output Some sort of error here
// Could not make (file) READ WRITE
return;
}
// Good - Output Some Soft of Message here ?
// (file) Is Read/Write
}
not sure if that answers your question
'g'
|
|
|
|
|
Good morning!
yeah, that it's!
With best regards!
break;
|
|
|
|
|
I am trying to repair the Curroupted Ms Access .mdb file.
here i able to get and insert most of the data from the Curroupted file to new created file by using the function defined in MsAccess class msacc9.olb in VC++.
I able to read and inser most of the data but unable to insert image in the OLE data field.
Is there any code or any othe way to do so.
Pls help me realated to this.
Thank You
Nirmal
|
|
|
|
|
|
Is there any way to get wheel mouse to work in the Call Stack Debug window in Visual C++ 6.0?
Wheel mouse works in normal source code windows.
|
|
|
|
|
Do you need to three actions from mouse(L/R/M)?
|
|
|
|
|
How to differentiate which is folder and which is files at run time?
|
|
|
|
|
kiranin wrote: differentiate which is folder and which is files at run time?
See WIN32_FIND_DATA
The first parameter to this has the information about the file/folder attributes.
FILE_ATTRIBUTE_DIRECTORY-The handle identifies a directory.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
hi all,
I need to display the 'Browse For Folder' Dialog window, but I need to place it in a combo box instead of being a popup dialog, so can anybody help with this???
Thanks
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
You can insert your controls to it but for insert it to combobox I dont know why you want to insert it to combobox do you need to folders?
|
|
|
|
|
I dont want to display in a combo box so that it doesnt take much of the dialog area...
do u know how???
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
You can use from CTreeCtrl and see examples for file/folder with CTreeCtrl on codeproject did you see them?
|
|
|
|
|
Hi,
I am trying to develop a socket server which will communicat with Microsoft Office in LAN.
But I don't know even a small bit about socket server. Can anyone help me out? Please Reply as soon as possible.
Thank you.
|
|
|
|