wdbg: temporarily removed LOCALIZED_TEXT so this works in another project. must find long-term solution: lib/ must not be dependent on ps/!
sysdep.h: add pick_dir sysdep/win/win.cpp: .. and its win32 implementation This was SVN commit r1655.
This commit is contained in:
parent
39783e6a17
commit
090ea2301a
@ -34,6 +34,8 @@ extern int clipboard_free(wchar_t* copy);
|
||||
|
||||
extern int get_executable_name(char* n_path, size_t buf_size);
|
||||
|
||||
extern int pick_directory(char* n_path, size_t buf_size);
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
extern double round(double);
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "assert_dlg.h"
|
||||
|
||||
|
||||
#define LOCALISED_TEXT
|
||||
//#define LOCALISED_TEXT
|
||||
|
||||
#ifdef LOCALISED_TEXT
|
||||
#include "ps/i18n.h"
|
||||
@ -763,12 +763,14 @@ int debug_main_exception_filter(unsigned int UNUSEDPARAM(code), PEXCEPTION_POINT
|
||||
{
|
||||
if (ep->ExceptionRecord->NumberParameters == 3)
|
||||
{
|
||||
/*/*
|
||||
PSERROR* err = (PSERROR*) ep->ExceptionRecord->ExceptionInformation[1];
|
||||
if (err->magic == 0x45725221)
|
||||
{
|
||||
int code = err->code;
|
||||
error = GetErrorString(code);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
__except (EXCEPTION_EXECUTE_HANDLER)
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> // __argc
|
||||
#include <malloc.h>
|
||||
#include <shlobj.h> // pick_dir
|
||||
|
||||
extern HWND hWnd;
|
||||
|
||||
@ -56,6 +57,43 @@ inline int get_executable_name(char* n_path, size_t buf_size)
|
||||
return nbytes? 0 : -1;
|
||||
}
|
||||
|
||||
static int CALLBACK browse_cb(HWND hWnd, unsigned int msg, LPARAM lParam, LPARAM ldata)
|
||||
{
|
||||
if(msg == BFFM_INITIALIZED)
|
||||
{
|
||||
const char* cur_dir = (const char*)ldata;
|
||||
SendMessage(hWnd, BFFM_SETSELECTIONA, 1, (LPARAM)cur_dir);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pick_directory(char* path, size_t buf_size)
|
||||
{
|
||||
IMalloc* p_malloc;
|
||||
SHGetMalloc(&p_malloc);
|
||||
|
||||
GetCurrentDirectory(PATH_MAX, path);
|
||||
|
||||
/// ShowWindow(hWnd, SW_HIDE);
|
||||
|
||||
BROWSEINFOA bi;
|
||||
memset(&bi, 0, sizeof(bi));
|
||||
bi.ulFlags = BIF_RETURNONLYFSDIRS;
|
||||
bi.lpfn = (BFFCALLBACK)browse_cb;
|
||||
bi.lParam = (LPARAM)path;
|
||||
ITEMIDLIST* pidl = SHBrowseForFolderA(&bi);
|
||||
BOOL ok = SHGetPathFromIDList(pidl, path);
|
||||
|
||||
/// ShowWindow(hWnd, SW_SHOW);
|
||||
|
||||
p_malloc->Free(pidl);
|
||||
p_malloc->Release();
|
||||
|
||||
return ok? 0 : -1;
|
||||
}
|
||||
|
||||
|
||||
void display_msg(const char* caption, const char* msg)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user