Click here to Skip to main content
16,004,927 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: My app cannot be moved or close, doesen't react to mouseclicks on the window Pin
Rickard Andersson201-May-02 4:13
Rickard Andersson201-May-02 4:13 
GeneralRe: My app cannot be moved or close, doesen't react to mouseclicks on the window Pin
1-May-02 4:25
suss1-May-02 4:25 
GeneralRe: My app cannot be moved or close, doesen't react to mouseclicks on the window Pin
Roger Stewart1-May-02 8:35
professionalRoger Stewart1-May-02 8:35 
GeneralRe: My app cannot be moved or close, doesen't react to mouseclicks on the window Pin
Tim Smith1-May-02 8:42
Tim Smith1-May-02 8:42 
GeneralMSWord 2000 events Pin
Ram Cronus1-May-02 1:48
Ram Cronus1-May-02 1:48 
GeneralForce 'OnFileSaveAs' problem Pin
LittleYellowBird1-May-02 1:08
LittleYellowBird1-May-02 1:08 
GeneralRe: Force 'OnFileSaveAs' problem Pin
LittleYellowBird1-May-02 1:18
LittleYellowBird1-May-02 1:18 
GeneralRe: Force 'OnFileSaveAs' problem Pin
Lucky the code machine1-May-02 1:35
Lucky the code machine1-May-02 1:35 
Hi, hope this helps. The Load & Save Dialogs are the same just put save insted of open. This code works as one chunk, lpstrInitialDir is the dir that it starts in to answer your question:

OPENFILENAME OpnFileStruct; // structure for GetOpenFileName
char szFile[256] = "\0";// Buffer for the filename
// Size of structure
OpnFileStruct.lStructSize = sizeof(OPENFILENAME);
// Handle to the parent window
OpnFileStruct.hwndOwner = this->GetSafeHwnd();
// Filters
OpnFileStruct.lpstrFilter = "GIF or JPEG Image\0*.gif;*.jpg";//"GIF Image\0*.gif\0JPEG Image\0*.jpg";
// Index for the filter
OpnFileStruct.nFilterIndex = 2;
// Buffer which will recieve filename
OpnFileStruct.lpstrFile = szFile;
// Size of buffer which will recieve filename
OpnFileStruct.nMaxFile = sizeof(szFile);
// Title of the open dialog
OpnFileStruct.lpstrTitle = "Select a Background Image";
// Flags
OpnFileStruct.Flags = OFN_FILEMUSTEXIST;
OpnFileStruct.hInstance = NULL;
OpnFileStruct.nFileOffset = 0;
OpnFileStruct.nFileExtension = 0;
OpnFileStruct.lpstrDefExt = NULL;
OpnFileStruct.lCustData = NULL;
OpnFileStruct.lpfnHook = NULL;
OpnFileStruct.lpTemplateName = NULL;
OpnFileStruct.lpstrFileTitle = NULL;
OpnFileStruct.nMaxFileTitle = 0;
OpnFileStruct.lpstrInitialDir = "C:\\media\\"; //!!!!! This wot u mean?
OpnFileStruct.lpstrCustomFilter = NULL;
OpnFileStruct.nMaxCustFilter = 0;
// Next line stops read only button showing & stops moving to selected dir
OpnFileStruct.Flags = OFN_NOCHANGEDIR|OFN_HIDEREADONLY;

// Show open dialog box
GetOpenFileName(&OpnFileStruct);
// Update the edit box with the selected file
m_Back_Image=szFile;
UpdateData(false);

An Expert is somone who has previously made ALL the Mistakes, I dream of this day. - Lucky
GeneralRe: Force 'OnFileSaveAs' problem Pin
LittleYellowBird1-May-02 23:30
LittleYellowBird1-May-02 23:30 
GeneralRe: Force 'OnFileSaveAs' problem Pin
Lucky the code machine3-May-02 7:44
Lucky the code machine3-May-02 7:44 
QuestionHow to create DOM object? Pin
Hans Ruck1-May-02 1:03
Hans Ruck1-May-02 1:03 
AnswerRe: How to create DOM object? Pin
Matt Philmon1-May-02 1:53
Matt Philmon1-May-02 1:53 
GeneralRe: How to create DOM object? Pin
Hans Ruck1-May-02 1:59
Hans Ruck1-May-02 1:59 
GeneralRe: How to create DOM object? Pin
Matt Philmon1-May-02 2:15
Matt Philmon1-May-02 2:15 
GeneralProblem with menu Pin
1-May-02 0:23
suss1-May-02 0:23 
GeneralRe: Problem with menu Pin
Matt Philmon1-May-02 1:54
Matt Philmon1-May-02 1:54 
GeneralRe: Problem with menu Pin
Renjith Ramachandran1-May-02 7:36
Renjith Ramachandran1-May-02 7:36 
GeneralPC Camera Capture Pin
Sameer Maggon30-Apr-02 21:41
Sameer Maggon30-Apr-02 21:41 
GeneralRe: PC Camera Capture Pin
Derek Lakin30-Apr-02 22:27
Derek Lakin30-Apr-02 22:27 
GeneralRe: PC Camera Capture Pin
Sameer Maggon2-May-02 18:24
Sameer Maggon2-May-02 18:24 
GeneralRe: PC Camera Capture Pin
Derek Lakin2-May-02 19:54
Derek Lakin2-May-02 19:54 
GeneralNeed Help with Dialogs Pin
Brind_Foin30-Apr-02 21:03
Brind_Foin30-Apr-02 21:03 
GeneralRe: Need Help with Dialogs Pin
Tom Archer30-Apr-02 22:33
Tom Archer30-Apr-02 22:33 
GeneralRe: Need Help with Dialogs Pin
Brind_Foin1-May-02 3:13
Brind_Foin1-May-02 3:13 
GeneralRe: Need Help with Dialogs Pin
Tom Archer1-May-02 3:23
Tom Archer1-May-02 3:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.