Einzelnen Beitrag anzeigen

Fukiszo
(Gast)

n/a Beiträge
 
#1

DragAcceptFiles - Was kann alles ein gültiges Ziel sein?

  Alt 18. Jan 2018, 22:25
Hallo WinAPI Programmierer!

Ich hab irgendwie den Wurm drinn und bräuchte etwas Rat...

Hier die Situation:

Ich erstelle ganz normal ein Window-Dialog-Fenster ohne EXSTYLE WS_EX_ACCEPTFILES

Hier mein Dialog STYLE Header:
STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME | WS_MINIMIZEBOX
EXSTYLE WS_EX_OVERLAPPEDWINDOW | WS_EX_TOPMOST | WS_EX_STATICEDGE | WS_EX_APPWINDOW | WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR | WS_EX_NOINHERITLAYOUT

Hier mein Test CONTROL:
CONTROL "> Drop <", 1234, STATIC, SS_CENTER | WS_CHILD | WS_VISIBLE | WS_GROUP, 10, 10, 50, 50

Im Source verwende ich in der Init-Phase dieses Kommando:
DragAcceptFiles(GetDlgItem(hWin, 1234), True);

Ich habe auch WM_DROPFILES in meiner DlgProc() routine eingearbeitet aber bei Ausführung ist 1234 kein Drop-Target.

Wenn ich als CONTROL eine LISTBOX nehm, funktioniert es.
Wenn ich im EXSTYLE WS_EX_ACCEPTFILES angebe, ist das ganze Window ein Drop-Target (nicht erwünscht)

Was mache ich falsch oder akzeptiert DragAcceptFiles() nur bestimmte CONTROL's als Ziel ??
Oder muss ich die CONTROL mit einem bestimmten Parameter initialisieren in der .RC datei?

Ich hab dutzende kombinationen ausprobiert und komm einfach nicht weiter.

Meine Win32.hlp sagt:

Zitat:
The DragAcceptFiles function registers whether a window accepts dropped files.
VOID DragAcceptFiles(
HWND hWnd, // handle to the registering window
BOOL fAccept // acceptance option
);
Parameters
hWnd Identifies the window registering whether it accepts dropped files.
fAccept Specifies whether the window identified by the hWnd parameter accepts dropped files. This value is TRUE to accept dropped files; it is FALSE to discontinue accepting dropped files.

Return Values
This function does not return a value.

Remarks
An application that calls DragAcceptFiles with the fAccept parameter set to TRUE has identified itself as able to process the WM_DROPFILES message from File Manager.
Ich versteh es grad einfach nicht worin mein Fehler liegt und komme nicht weiter *schnief*

Hat jemand einen guten Tipp für mich?

Grüße
  Mit Zitat antworten Zitat