bool
CMsWin32Editbox::EditboxCreate( CMsWin32Window& parent           ,
                                const CString& windowTitle       ,
                                const bool createAsMultilineEdit ,
                                const Int32 xPosition            ,
                                const Int32 yPosition            ,
                                const UInt32 width               ,
                                const UInt32 height              ,
                                const bool readOnly              )
{GUCEF_TRACE;

    if ( 0 != GetHwnd() )
    {
        DestroyWindow( GetHwnd() );
        SetHwnd( 0 );
    }

    DWORD dwStyle = 0;
    if ( readOnly )
    {
        dwStyle |= ES_READONLY;
    }
    
    if ( createAsMultilineEdit )
    {        
        dwStyle |= WS_VISIBLE|WS_CHILD|WS_BORDER|WS_VSCROLL|WS_HSCROLL|ES_MULTILINE|ES_WANTRETURN|ES_AUTOHSCROLL|ES_AUTOVSCROLL;
        
        SetHwnd( CreateWindow( "edit", 
                               windowTitle.C_String(),
                               dwStyle,
                               xPosition, yPosition, (int)width, (int)height, 
                               parent.GetHwnd(), (HMENU)this, GetCurrentModuleHandle(), (LPVOID)this ) );
    }
    else
    {        
        dwStyle |= WS_VISIBLE|WS_CHILD|WS_BORDER|ES_AUTOHSCROLL|ES_AUTOVSCROLL;
        
        SetHwnd( CreateWindow( "edit", 
                               windowTitle.C_String(),
                               dwStyle,
                               xPosition, yPosition, (int)width, (int)height, 
                               parent.GetHwnd(), (HMENU)this, GetCurrentModuleHandle(), (LPVOID)this ) );
    }

    if ( GetHwnd() != 0 )
    {
        HookWndProc();
        return true;
    }            
    return false;
}
Ejemplo n.º 2
0
void CFlukeSlave::Create(HMODULE h)
{
  DBGTRACE("FlukeInit(%08x)\n",h);
  if(h==0)
    h=GetCurrentModuleHandle();
  flukeslave(h);
}
Ejemplo n.º 3
0
extern "C" _declspec(dllexport) bool StormGETPluginInit() {
	HGLOBAL hResourceLoaded;  // handle to loaded resource
    HRSRC   hRes;              // handle/ptr to res. info.
    char    *lpResLock;        // pointer to resource data
    DWORD   dwSizeRes;
    hRes = FindResource(GetCurrentModuleHandle(),MAKEINTRESOURCE(IDR_ARIA2),CString(L"BIN"));
    hResourceLoaded = LoadResource(GetCurrentModuleHandle(), hRes);
    lpResLock = (char *) LockResource(hResourceLoaded);
    dwSizeRes = SizeofResource(GetCurrentModuleHandle(), hRes);
	FILE * outputRes;
	if(outputRes = _wfopen(L"Plugins\\Binaries\\aria2c.exe", L"wb")) {
		fwrite ((const char *) lpResLock,1,dwSizeRes,outputRes);
		fclose(outputRes);
	}

	return TRUE;
}
Ejemplo n.º 4
0
static bool IsAddressInCurrentModule(void *address) {
	return GetCurrentModuleHandle() == GetModuleHandleFromAddress(address);
}
Ejemplo n.º 5
0
std::wstring GetCurrentModuleName()
{
	return GetModuleName(GetCurrentModuleHandle());
}
Ejemplo n.º 6
0
std::wstring GetCurrentModuleDirectory()
{
	return GetModuleDirectory(GetCurrentModuleHandle());
}
Ejemplo n.º 7
0
void ProgressBarDialog::show()
{
  m_hDialog = CreateDialog ((HINSTANCE)GetCurrentModuleHandle(), MAKEINTRESOURCE (IDD_DIALOG1), 0, ProgressBarDialog::DialogProc);
}