|
@@ -26,14 +26,6 @@ static HWND mouseHwnd;
|
|
static BBObject *mouseSource;
|
|
static BBObject *mouseSource;
|
|
static int mouseVisible;
|
|
static int mouseVisible;
|
|
|
|
|
|
-static const wchar_t *appTitleW(){
|
|
|
|
- return bbStringToWString( bbAppTitle );
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static const char *appTitleA(){
|
|
|
|
- return bbStringToCString( bbAppTitle );
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static int keyCode( WPARAM wp,LPARAM lp){
|
|
static int keyCode( WPARAM wp,LPARAM lp){
|
|
switch( ((lp>>17)&0x80)|((lp>>16)&0x7f) ){
|
|
switch( ((lp>>17)&0x80)|((lp>>16)&0x7f) ){
|
|
case 42:return VK_LSHIFT;
|
|
case 42:return VK_LSHIFT;
|
|
@@ -315,9 +307,17 @@ static int systemPanel( BBString *text,int flags ){
|
|
|
|
|
|
beginPanel();
|
|
beginPanel();
|
|
if( _usew ){
|
|
if( _usew ){
|
|
- n=MessageBoxW( GetActiveWindow(),bbTmpWString(text),appTitleW(),flags );
|
|
|
|
|
|
+ BBChar *p=bbStringToWString( text );
|
|
|
|
+ BBChar *t=bbStringToWString( bbAppTitle );
|
|
|
|
+ n=MessageBoxW( GetActiveWindow(),p,t,flags );
|
|
|
|
+ bbMemFree(t);
|
|
|
|
+ bbMemFree(p);
|
|
}else{
|
|
}else{
|
|
- n=MessageBoxA( GetActiveWindow(),bbTmpCString(text),appTitleA(),flags );
|
|
|
|
|
|
+ char *p=bbStringToCString( text );
|
|
|
|
+ char *t=bbStringToCString( bbAppTitle );
|
|
|
|
+ n=MessageBoxA( GetActiveWindow(),p,t,flags );
|
|
|
|
+ bbMemFree(t);
|
|
|
|
+ bbMemFree(p);
|
|
}
|
|
}
|
|
endPanel();
|
|
endPanel();
|
|
return n;
|
|
return n;
|
|
@@ -354,14 +354,20 @@ BBString *bbSystemRequestFile( BBString *text,BBString *exts,int defext,int save
|
|
wchar_t buf[MAX_PATH];
|
|
wchar_t buf[MAX_PATH];
|
|
OPENFILENAMEW of={sizeof(of)};
|
|
OPENFILENAMEW of={sizeof(of)};
|
|
|
|
|
|
- wcscpy( buf,bbTmpWString( file ) );
|
|
|
|
|
|
+ BBChar *p=bbStringToWString( file );
|
|
|
|
+ wcscpy( buf,p );
|
|
|
|
+ bbMemFree(p);
|
|
|
|
+
|
|
|
|
+ BBChar *t=bbStringToWString( text );
|
|
|
|
+ BBChar *e=bbStringToWString( exts );
|
|
|
|
+ BBChar *d = 0;
|
|
|
|
|
|
of.hwndOwner=GetActiveWindow();
|
|
of.hwndOwner=GetActiveWindow();
|
|
- of.lpstrTitle=bbTmpWString( text );
|
|
|
|
- of.lpstrFilter=bbTmpWString( exts );
|
|
|
|
|
|
+ of.lpstrTitle=t;
|
|
|
|
+ of.lpstrFilter=e;
|
|
of.nFilterIndex=defext;
|
|
of.nFilterIndex=defext;
|
|
of.lpstrFile=buf;
|
|
of.lpstrFile=buf;
|
|
- of.lpstrInitialDir=dir->length ? bbTmpWString( dir ) : 0;
|
|
|
|
|
|
+ of.lpstrInitialDir=dir->length ? d=bbStringToWString( dir ) : 0;
|
|
of.nMaxFile=MAX_PATH;
|
|
of.nMaxFile=MAX_PATH;
|
|
of.Flags=OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
|
|
of.Flags=OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
|
|
|
|
|
|
@@ -379,18 +385,28 @@ BBString *bbSystemRequestFile( BBString *text,BBString *exts,int defext,int save
|
|
}
|
|
}
|
|
}
|
|
}
|
|
endPanel();
|
|
endPanel();
|
|
|
|
+
|
|
|
|
+ bbMemFree(d);
|
|
|
|
+ bbMemFree(e);
|
|
|
|
+ bbMemFree(t);
|
|
}else{
|
|
}else{
|
|
char buf[MAX_PATH];
|
|
char buf[MAX_PATH];
|
|
OPENFILENAMEA of={sizeof(of)};
|
|
OPENFILENAMEA of={sizeof(of)};
|
|
|
|
|
|
- strcpy( buf,bbTmpCString( file ) );
|
|
|
|
|
|
+ char *p=bbStringToCString( file );
|
|
|
|
+ strcpy( buf,p );
|
|
|
|
+ bbMemFree(p);
|
|
|
|
|
|
|
|
+ char *t=bbStringToCString( text );
|
|
|
|
+ char *e=bbStringToCString( exts );
|
|
|
|
+ char *d=0;
|
|
|
|
+
|
|
of.hwndOwner=GetActiveWindow();
|
|
of.hwndOwner=GetActiveWindow();
|
|
- of.lpstrTitle=bbTmpCString( text );
|
|
|
|
- of.lpstrFilter=bbTmpCString( exts );
|
|
|
|
|
|
+ of.lpstrTitle=t;
|
|
|
|
+ of.lpstrFilter=e;
|
|
of.nFilterIndex=defext;
|
|
of.nFilterIndex=defext;
|
|
of.lpstrFile=buf;
|
|
of.lpstrFile=buf;
|
|
- of.lpstrInitialDir=dir->length ? bbTmpCString( dir ) : 0;
|
|
|
|
|
|
+ of.lpstrInitialDir=dir->length ? d=bbStringToCString( dir ) : 0;
|
|
of.nMaxFile=MAX_PATH;
|
|
of.nMaxFile=MAX_PATH;
|
|
of.Flags=OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
|
|
of.Flags=OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
|
|
|
|
|
|
@@ -409,6 +425,10 @@ BBString *bbSystemRequestFile( BBString *text,BBString *exts,int defext,int save
|
|
}
|
|
}
|
|
}
|
|
}
|
|
endPanel();
|
|
endPanel();
|
|
|
|
+
|
|
|
|
+ bbMemFree(d);
|
|
|
|
+ bbMemFree(e);
|
|
|
|
+ bbMemFree(t);
|
|
}
|
|
}
|
|
return str;
|
|
return str;
|
|
}
|
|
}
|
|
@@ -453,10 +473,14 @@ BBString *bbSystemRequestDir( BBString *text,BBString *dir ){
|
|
BROWSEINFOW bi={0};
|
|
BROWSEINFOW bi={0};
|
|
wchar_t buf[MAX_PATH],*p;
|
|
wchar_t buf[MAX_PATH],*p;
|
|
|
|
|
|
- GetFullPathNameW( bbTmpWString(dir),MAX_PATH,buf,&p );
|
|
|
|
|
|
+ BBChar *d=bbStringToWString( dir );
|
|
|
|
+ GetFullPathNameW( d,MAX_PATH,buf,&p );
|
|
|
|
+ bbMemFree(d);
|
|
|
|
+
|
|
|
|
+ BBChar *t=bbStringToWString( text );
|
|
|
|
|
|
bi.hwndOwner=GetActiveWindow();
|
|
bi.hwndOwner=GetActiveWindow();
|
|
- bi.lpszTitle=bbTmpWString( text );
|
|
|
|
|
|
+ bi.lpszTitle=t;
|
|
bi.ulFlags=BIF_RETURNONLYFSDIRS|BIF_NEWDIALOGSTYLE;
|
|
bi.ulFlags=BIF_RETURNONLYFSDIRS|BIF_NEWDIALOGSTYLE;
|
|
bi.lpfn=BrowseForFolderCallbackW;
|
|
bi.lpfn=BrowseForFolderCallbackW;
|
|
bi.lParam=(LPARAM)buf;
|
|
bi.lParam=(LPARAM)buf;
|
|
@@ -465,6 +489,8 @@ BBString *bbSystemRequestDir( BBString *text,BBString *dir ){
|
|
idlist=SHBrowseForFolderW(&bi);
|
|
idlist=SHBrowseForFolderW(&bi);
|
|
endPanel();
|
|
endPanel();
|
|
|
|
|
|
|
|
+ bbMemFree(t);
|
|
|
|
+
|
|
if( idlist ){
|
|
if( idlist ){
|
|
SHGetPathFromIDListW( idlist,buf );
|
|
SHGetPathFromIDListW( idlist,buf );
|
|
str=bbStringFromWString( buf );
|
|
str=bbStringFromWString( buf );
|
|
@@ -476,10 +502,14 @@ BBString *bbSystemRequestDir( BBString *text,BBString *dir ){
|
|
BROWSEINFOA bi={0};
|
|
BROWSEINFOA bi={0};
|
|
char buf[MAX_PATH],*p;
|
|
char buf[MAX_PATH],*p;
|
|
|
|
|
|
- GetFullPathNameA( bbTmpCString(dir),MAX_PATH,buf,&p );
|
|
|
|
|
|
+ char *d=bbStringToCString( dir );
|
|
|
|
+ GetFullPathNameA( d,MAX_PATH,buf,&p );
|
|
|
|
+ bbMemFree(d);
|
|
|
|
+
|
|
|
|
+ char *t=bbStringToCString( text );
|
|
|
|
|
|
bi.hwndOwner=GetActiveWindow();
|
|
bi.hwndOwner=GetActiveWindow();
|
|
- bi.lpszTitle=bbTmpCString( text );
|
|
|
|
|
|
+ bi.lpszTitle=t;
|
|
bi.ulFlags=BIF_RETURNONLYFSDIRS|BIF_NEWDIALOGSTYLE;
|
|
bi.ulFlags=BIF_RETURNONLYFSDIRS|BIF_NEWDIALOGSTYLE;
|
|
bi.lpfn=BrowseForFolderCallbackA;
|
|
bi.lpfn=BrowseForFolderCallbackA;
|
|
bi.lParam=(LPARAM)buf;
|
|
bi.lParam=(LPARAM)buf;
|
|
@@ -488,6 +518,8 @@ BBString *bbSystemRequestDir( BBString *text,BBString *dir ){
|
|
idlist=SHBrowseForFolderA(&bi);
|
|
idlist=SHBrowseForFolderA(&bi);
|
|
endPanel();
|
|
endPanel();
|
|
|
|
|
|
|
|
+ bbMemFree(t);
|
|
|
|
+
|
|
if( idlist ){
|
|
if( idlist ){
|
|
SHGetPathFromIDListA( idlist,buf );
|
|
SHGetPathFromIDListA( idlist,buf );
|
|
str=bbStringFromCString( buf );
|
|
str=bbStringFromCString( buf );
|
|
@@ -500,9 +532,13 @@ BBString *bbSystemRequestDir( BBString *text,BBString *dir ){
|
|
int bbOpenURL( BBString *url ){
|
|
int bbOpenURL( BBString *url ){
|
|
int n;
|
|
int n;
|
|
if( _usew ){
|
|
if( _usew ){
|
|
- n=(int)ShellExecuteW( 0,0,(wchar_t*)bbTmpWString(url),0,0,10 )>32; //SW_SHOWDEFAULT
|
|
|
|
|
|
+ BBChar *p=bbStringToWString( url );
|
|
|
|
+ n=(int)ShellExecuteW( 0,0,(wchar_t*)p,0,0,10 )>32; //SW_SHOWDEFAULT
|
|
|
|
+ bbMemFree(p);
|
|
}else{
|
|
}else{
|
|
- n=(int)ShellExecuteA( 0,0,bbTmpCString(url),0,0,10 )>32; //SW_SHOWDEFAULT
|
|
|
|
|
|
+ char *p=bbStringToCString( url );
|
|
|
|
+ n=(int)ShellExecuteA( 0,0,p,0,0,10 )>32; //SW_SHOWDEFAULT
|
|
|
|
+ bbMemFree(p);
|
|
}
|
|
}
|
|
return n;
|
|
return n;
|
|
}
|
|
}
|