当前位置: 首页>>代码示例>>C++>>正文


C++ DragAcceptFiles函数代码示例

本文整理汇总了C++中DragAcceptFiles函数的典型用法代码示例。如果您正苦于以下问题:C++ DragAcceptFiles函数的具体用法?C++ DragAcceptFiles怎么用?C++ DragAcceptFiles使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DragAcceptFiles函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TPack_InitializeDialog

static BOOL TPack_InitializeDialog (HWND hwnd)
{
	TPack_WindowData *	pData;
	HFONT				Font;
	HWND				ListWnd;

	// allocate window local data structure
	pData = GE_RAM_ALLOCATE_STRUCT (TPack_WindowData);
	if (pData == NULL)
	{
		DestroyWindow (hwnd);
		return TRUE;
	}

	// and initialize it
	pData->Instance		 = (HINSTANCE)GetWindowLong (hwnd, GWL_HINSTANCE);
	pData->hwnd			 = hwnd;
	pData->BitmapCount	 = 0;
	pData->Bitmaps		 = NULL;
	pData->SelectedEntry = NULL;
	pData->FileNameIsValid = FALSE;
	pData->Dirty		 = FALSE;
	// Set the window data pointer in the GWL_USERDATA field
	SetWindowLong(hwnd, GWL_USERDATA, (LONG)pData);
	SetWindowLong(GetDlgItem(hwnd, IDC_PREVIEW), GWL_USERDATA, (LONG)pData);
	SetWindowLong(GetDlgItem(hwnd, IDC_PREVIEW), GWL_WNDPROC, (LONG)TPack_PreviewWndProc);

	ListWnd = GetDlgItem(hwnd, IDC_TEXTURELIST);
	SetWindowLong(ListWnd, GWL_USERDATA, (LONG)GetWindowLong(ListWnd, GWL_WNDPROC));
	SetWindowLong(ListWnd, GWL_WNDPROC, (LONG)TPack_ListBoxWndProc);
	
	Font = CreateFont( -24,
    					    0,0,0, 0,
    					    0,0,0,0,OUT_TT_ONLY_PRECIS ,0,0,0, "Arial Black");
    SendDlgItemMessage(hwnd, IDC_TEXTURESIZE, WM_SETFONT, (WPARAM)Font, MAKELPARAM(TRUE, 0));

	// set the program icon on the dialog window
	SendMessage (hwnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon (pData->Instance, MAKEINTRESOURCE (IDI_MAINICON)));

	DragAcceptFiles (hwnd, TRUE);

	return TRUE;
}
开发者ID:RealityFactory,项目名称:Genesis3D-Tools,代码行数:43,代码来源:TPack.c

示例2: DcxControl

DcxEdit::DcxEdit(const UINT ID, DcxDialog *p_Dialog, const HWND mParentHwnd, const RECT *rc, TString &styles)
: DcxControl(ID, p_Dialog)
{
	LONG Styles = 0, ExStyles = 0;
	BOOL bNoTheme = FALSE;
	this->parseControlStyles(styles, &Styles, &ExStyles, &bNoTheme);

	this->m_Hwnd = CreateWindowExW(
		ExStyles | WS_EX_CLIENTEDGE, 
		L"EDIT",
		NULL,
		WS_CHILD | Styles,
		rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top,
		mParentHwnd,
		(HMENU) ID,
		GetModuleHandle(NULL), 
		NULL);

	if (!IsWindow(this->m_Hwnd))
		throw "Unable To Create Window";

	if (bNoTheme)
		Dcx::UXModule.dcxSetWindowTheme(this->m_Hwnd , L" ", L" ");

	Edit_LimitText(this->m_Hwnd, 0);
	//this->m_tsText = "";

	//SendMessage(this->m_Hwnd, CCM_SETUNICODEFORMAT, TRUE, NULL);

	if (p_Dialog->getToolTip() != NULL) {
		if (styles.istok("tooltips")) {
			this->m_ToolTipHWND = p_Dialog->getToolTip();
			AddToolTipToolInfo(this->m_ToolTipHWND, this->m_Hwnd);
		}
	}

	this->m_bIgnoreRepeat = TRUE;
	this->setControlFont((HFONT) GetStockObject(DEFAULT_GUI_FONT), FALSE);
	this->registreDefaultWindowProc();
	SetProp(this->m_Hwnd, "dcx_cthis", (HANDLE) this);
	DragAcceptFiles(this->m_Hwnd, TRUE);
}
开发者ID:dlsocool,项目名称:dcx,代码行数:42,代码来源:dcxedit.cpp

示例3: getHandle

bool Chkdraft::CreateSubWindows()
{
    HWND hWnd = getHandle();
    if ( hWnd != NULL )
    {
        DragAcceptFiles(hWnd, TRUE);
        int statusWidths[] = { 130, 205, 350, 450, 600, -1 };

        return mainMenu.FindThis(hWnd) &&
            mainToolbar.CreateThis(hWnd, IDR_MAIN_TOOLBAR) &&
            statusBar.CreateThis(sizeof(statusWidths) / sizeof(int), statusWidths, 0,
                WS_CHILD | WS_VISIBLE | SBARS_SIZEGRIP, hWnd, (HMENU)IDR_MAIN_STATUS) &&
            mainPlot.CreateThis(hWnd, IDR_MAIN_PLOT) &&
            BecomeMDIFrame(maps, GetSubMenu(GetMenu(hWnd), 6), ID_MDI_FIRSTCHILD,
                WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL,
                0, 0, 0, 0, (HMENU)IDR_MAIN_MDI);
    }
    else
        return false;
}
开发者ID:RElesgoe,项目名称:Chkdraft,代码行数:20,代码来源:Chkdraft.cpp

示例4: WinD3DInit

int WinD3DInit(  )
{
    // Register the window class
    WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,
                      GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
                      "PhysView", NULL };
    RegisterClassEx( &wc );
	hInst = wc.hInstance;

    SetRect( &window_inset, 0, 0, 0, 0 );
    AdjustWindowRect( &window_inset, WS_OVERLAPPEDWINDOW, 0 );
    //RECT rc;
    //SetRect( &rc, 0, 0, Width, Height );
    //AdjustWindowRect( &rc, WS_OVERLAPPEDWINDOW, 0 );


    // Create the application's window
	Width = windowwidth;
	Height= windowheight;
    hWnd = CreateWindow( "PhysView", windowtitle,
                              WS_OVERLAPPEDWINDOW, windowx+window_inset.left, windowy+window_inset.top, Width+window_inset.right-window_inset.left, Height+window_inset.bottom-window_inset.top,
                              GetDesktopWindow(), NULL, wc.hInstance, NULL );
/* 	HWND parentwindow=GetDesktopWindow();
	parentwindow=(HWND)0xa0618;
   hWnd = CreateWindow( "PhysView", "PhysView",
                              WS_CHILD, 0, 0, 200,200,
                              parentwindow, NULL, wc.hInstance, NULL );
*/

    // Initialize Direct3D
    HRESULT hr;
	hr =  InitD3D( hWnd );

    // Show the window
    ShowWindow( hWnd, SW_SHOWDEFAULT );
    UpdateWindow( hWnd );
	DragAcceptFiles(hWnd,true);
	InitFont(g_pd3dDevice);

	return 1;
}
开发者ID:Thyfate,项目名称:melax,代码行数:41,代码来源:winsetup.cpp

示例5: DragAcceptFiles

BOOL CPPageExternalFilters::OnInitDialog()
{
	__super::OnInitDialog();

	DragAcceptFiles(TRUE);

	AppSettings& s = AfxGetAppSettings();

	m_pFilters.RemoveAll();

	POSITION pos = s.m_filters.GetHeadPosition();
	while (pos) {
		CAutoPtr<FilterOverride> f(DNew FilterOverride(s.m_filters.GetNext(pos)));

		CString name(_T("<unknown>"));

		if (f->type == FilterOverride::REGISTERED) {
			name = CFGFilterRegistry(f->dispname).GetName();
			if (name.IsEmpty()) {
				name = f->name + _T(" <not registered>");
			}
		} else if (f->type == FilterOverride::EXTERNAL) {
			name = f->name;
			if (f->fTemporary) {
				name += _T(" <temporary>");
			}
			if (!CPath(MakeFullPath(f->path)).FileExists()) {
				name += _T(" <not found!>");
			}
		}

		int i = m_filters.AddString(name);
		m_filters.SetCheck(i, f->fDisabled ? 0 : 1);
		m_filters.SetItemDataPtr(i, m_pFilters.AddTail(f));
	}

	UpdateData(FALSE);

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:avdbg,项目名称:MPC-BE,代码行数:41,代码来源:PPageExternalFilters.cpp

示例6: DragAcceptFiles

LRESULT MainDialog::OnInitDialog(HWND hwnd, LPARAM lp)
{
	WTL::CMessageLoop *loop = _Module.GetMessageLoop();
	loop->AddMessageFilter(this);
	
	DragAcceptFiles(*this, true);
	SetIcon(WTL::AtlLoadIconImage(IDI_MEDIAWIKI, 0,
		GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON)));
	SetIcon(WTL::AtlLoadIconImage(IDI_MEDIAWIKI, 0,
		GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)), false);
	
	EnableDlgItem(IDC_OPT_COMPRESS_FULL, false);
	EnableDlgItem(IDC_START, false);
	
	DoDataExchange();
	m_progress.SetRange(0, 100);
	
	m_waitcursor.LoadOEMCursor(IDC_WAIT);
	
	return false;
}
开发者ID:Tietew,项目名称:mediawiki-xml2sql,代码行数:21,代码来源:xml2sql-fe.cpp

示例7: InitInstance

//
//   函数: InitInstance(HINSTANCE, int)
//
//   目的: 保存实例句柄并创建主窗口
//
//   注释:
//
//        在此函数中,我们在全局变量中保存实例句柄并
//        创建和显示主程序窗口。
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
   HWND hWnd;

   hInst = hInstance; // 将实例句柄存储在全局变量中

   hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

   if (!hWnd)
   {
      return FALSE;
   }

   DragAcceptFiles(hWnd, TRUE);

   ShowWindow(hWnd, nCmdShow);
   UpdateWindow(hWnd);

   return TRUE;
}
开发者ID:yedaoq,项目名称:YedaoqToolSpace,代码行数:31,代码来源:Png2BmpW.cpp

示例8: system_window_init

//drag and drop support, call after window was initialized
void system_window_init(){

	//drag and drop
	#if TARGET_OS == WIN
		SDL_SysWMinfo wmInfo;

		//set SDL version to WMinfo struct
		//-> maybe problems when not calling this macro before
		SDL_VERSION(&wmInfo.version);  

		if(SDL_GetWMInfo(&wmInfo) != SDL_TRUE) {
			cerr << "Error on getting WMInfo" << endl;
			return;
		}

		SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
		DragAcceptFiles(wmInfo.window, true); //afxwin.h
	#endif
	
	//other OS ...
}
开发者ID:murkymark,项目名称:iffanimplay,代码行数:22,代码来源:system_specific.cpp

示例9: __declspec

void __declspec(dllexport) onDropFiles(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra)
{  
  HWND hwCtl;
  //LONG lwnd;
  nsFunction  callback;

  // get info from stack

  hwCtl = (HWND) popint();
  callback = (nsFunction) popint();

  if (!IsWindow(hwCtl))
    return;

  //lwnd = GetWindowLong(hwCtl, GWL_EXSTYLE);
  //SetWindowLong(hwCtl, GWL_EXSTYLE, lwnd | WS_EX_ACCEPTFILES);
	DragAcceptFiles(hwCtl, TRUE);

  pushint((nsFunction) callback);
//  pushint((int) hwCtl);

	if (hwCtl == g_window.hwWindow)
		SetWindowCallback(WND_CALLBACK_IDX(onDropFiles));
	else
		{
			//size_t id;
			//id = g_window.controlCount - 1;
			//MessageBox(g_window.hwWindow,"control dropfiles",NULL,MB_OK);
			//g_window.controls[id].oldWndProc = (WNDPROC) SetWindowLong(hwCtl, GWL_WNDPROC, (long) DropFilesWndProc);
			ctl = GetControl(hwCtl);
			if (ctl == NULL)
				return;
			ctl->oldWndProc = (WNDPROC) SetWindowLong(hwCtl, GWL_WNDPROC, (long) DropFilesWndProc);

			pushint((int) hwCtl);

			SetControlCallback(CTL_CALLBACK_IDX(onDropFiles));
		}
}
开发者ID:fengshao5411,项目名称:nswindows_domodal,代码行数:39,代码来源:nsDialogs.c

示例10: TRACE0

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

#if 0
        if (!m_wndToolBar.Create(this) ||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}
#endif

	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,
		  sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

#if 0
        // TODO: Remove this if you don't want tool tips or a resizeable toolbar
	m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	// TODO: Delete these three lines if you don't want the toolbar to
	//  be dockable
	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBar);
#endif

        // We accept drag and drop files
        DragAcceptFiles();

        return 0;
}
开发者ID:svagionitis,项目名称:libwww,代码行数:39,代码来源:MainFrm.cpp

示例11: TForm

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner),
  theBuffer(NULL),
  stopped(true)
{
    DragAcceptFiles(this->Handle, TRUE);
    bmp = new Graphics::TBitmap;
    bmp->PixelFormat = pf24bit;

    bmp->Canvas->Font->Assign(FontDialog1->Font);
    charWidth = bmp->Canvas->TextWidth("A");
    charHeight = bmp->Canvas->TextHeight("A");

    SetWindowLong(txtFrameSize->Handle, GWL_STYLE, GetWindowLong(txtFrameSize->Handle, GWL_STYLE) | ES_NUMBER);
    SetWindowLong(txtMinDelta->Handle, GWL_STYLE, GetWindowLong(txtMinDelta->Handle, GWL_STYLE) | ES_NUMBER);
    SetWindowLong(txtMaxDelta->Handle, GWL_STYLE, GetWindowLong(txtMaxDelta->Handle, GWL_STYLE) | ES_NUMBER);
    SetWindowLong(txtMaxResults->Handle, GWL_STYLE, GetWindowLong(txtMaxResults->Handle, GWL_STYLE) | ES_NUMBER);

    Panel2->DoubleBuffered = true;

    RedrawBitmap();
}
开发者ID:Bindambc,项目名称:MathApps,代码行数:23,代码来源:Unit1.cpp

示例12: TRACE0

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
        return -1;

    if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
                               | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
            !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
    {
        TRACE0("Failed to create toolbar\n");
        return -1;      // fail to create
    }

    if (!m_wndStatusBar.Create(this) ||
            !m_wndStatusBar.SetIndicators(indicators,
                                          sizeof(indicators)/sizeof(UINT)))
    {
        TRACE0("Failed to create status bar\n");
        return -1;      // fail to create
    }

    // TODO: Delete these three lines if you don't want the toolbar to
    // Enable drag/drop open
    DragAcceptFiles(TRUE);
    //  be dockable
    m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
    EnableDocking(CBRS_ALIGN_ANY);
    DockControlBar(&m_wndToolBar);
    // add panes
    m_wndStatusBar.SetPaneInfo( PANE_LENGTH_UNIT, ID_SEPARATOR, SBPS_NORMAL, 25);
    m_wndStatusBar.SetPaneInfo( PANE_CURSOR_POSITION, ID_SEPARATOR, SBPS_NORMAL, 72);
    m_wndStatusBar.SetPaneInfo( PANE_IMAGE_SIZE, ID_SEPARATOR, SBPS_NORMAL, 72);
    m_wndStatusBar.SetPaneInfo( PANE_BIT_COUNT, ID_SEPARATOR, SBPS_NORMAL, 28);
    m_wndStatusBar.SetPaneInfo( PANE_REGION_ID, ID_SEPARATOR, SBPS_NORMAL, 60);
    m_wndStatusBar.SetPaneInfo( PANE_REGION_SIZE, ID_SEPARATOR, SBPS_NORMAL, 30);
    m_wndStatusBar.SetPaneInfo( PANE_RN_COUNT, ID_SEPARATOR, SBPS_NORMAL, 15);
    return 0;
}
开发者ID:caomw,项目名称:ImageSegmentor,代码行数:38,代码来源:MainFrm.cpp

示例13: HookCreateWindowExA

HWND WINAPI HookCreateWindowExA(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam)
{
    RECT    rcWordArea;
    ULONG   Length;
    LPWSTR  ClassName, WindowName;
    HWND    hWnd;

    Length = StrLengthA(lpClassName) + 1;
    ClassName = (LPWSTR)AllocStack(Length * sizeof(WCHAR));
    AnsiToUnicode(ClassName, Length * sizeof(WCHAR), lpClassName, Length);

    Length = StrLengthA(lpWindowName) + 1;
    WindowName = (LPWSTR)AllocStack(Length * sizeof(WCHAR));
    AnsiToUnicode(WindowName, Length * sizeof(WCHAR), lpWindowName, Length);

    hWnd = CreateWindowExW(dwExStyle, ClassName, WindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
    if (hWnd == NULL)
        return hWnd;

    OrigWndProc = (WNDPROC)SetWindowLongPtrA(hWnd, GWLP_WNDPROC, (LONG_PTR)CMVS_MainWindowProc);
    DragAcceptFiles(hWnd, TRUE);

    return hWnd;
}
开发者ID:Emiyasviel,项目名称:Arianrhod,代码行数:24,代码来源:cmvs.cpp

示例14: WinMain

int PASCAL WinMain (HINSTANCE hCurrentInstance,
        		    HINSTANCE hPrevInstance,
                    LPSTR lpszCmdLine, 
                    int nCmdShow)
   {  // WinMain
   MSG      msg;

   if (!PerfmonInitialize (hCurrentInstance, hPrevInstance, 
                           lpszCmdLine, nCmdShow))
      return (FALSE) ;

   DragAcceptFiles (hWndMain, TRUE) ;

   while (GetMessage (&msg, NULL, 0, 0))
      {
      if (!TranslateAccelerator(hWndMain, hAccelerators, &msg))
         {
         TranslateMessage (&msg) ;
         DispatchMessage (&msg) ;
         }
      }  // while

   return(msg.wParam);
   }
开发者ID:mingpen,项目名称:OpenNT,代码行数:24,代码来源:perfmon.c

示例15: _T

// the constructor creates the window
Viewer::Viewer(HWND parent, const TCHAR *current_filename)
{
    DWORD styles;

    m_hwndViewer=NULL;
    m_dib = NULL;
    m_bits = NULL;
    m_errorflag=0;

    styles = WS_OVERLAPPEDWINDOW;
    styles &= ~WS_MINIMIZEBOX;
    m_hwndViewer=CreateWindow(
                     _T("TPNGVIEWER"),_T(""),styles,
                     CW_USEDEFAULT,  // horizontal position
                     CW_USEDEFAULT,	// vertical position
                     CW_USEDEFAULT,	// width
                     CW_USEDEFAULT,  // height
                     parent,NULL,globals.hInst,NULL);
    if(!m_hwndViewer) return;

    twpng_SetWindowPos(m_hwndViewer,&globals.window_prefs.viewer);
    SetCurrentFileName(current_filename);
    UpdateViewerWindowTitle();
    ShowWindow(m_hwndViewer,globals.window_prefs.viewer.max?SW_SHOWMAXIMIZED:SW_SHOWNOACTIVATE);
    GetClientRect(m_hwndViewer,&m_clientrect);

    // Allowing files to be droppped into the viewer window is sort of a hack,
    // but it's convenient. We have to be careful not to react to a dropped
    // file if the main application has a dialog box open that could be in the
    // middle of editing a file.
    DragAcceptFiles(m_hwndViewer,TRUE);

    m_dragging=0;
    m_imgpos_x = globals.viewer_imgpos_x;
    m_imgpos_y = globals.viewer_imgpos_y;
}
开发者ID:dbremner,项目名称:tweakpng,代码行数:37,代码来源:viewer.cpp


注:本文中的DragAcceptFiles函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。