AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi ToolBar-Button einem anderen Fenster übergeben
Thema durchsuchen
Ansicht
Themen-Optionen

ToolBar-Button einem anderen Fenster übergeben

Ein Thema von Pseudemys Nelsoni · begonnen am 30. Mai 2004 · letzter Beitrag vom 9. Jun 2004
Antwort Antwort
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#1

ToolBar-Button einem anderen Fenster übergeben

  Alt 30. Mai 2004, 20:10
moin,

ich habe versucht per SetParent einer Toolbar eines anderen Programms einen ToolButton zu übergeben...aber das habe ich nicht hinbekommen, weil mein Toolbutton gar kein ".Handle" hat, ist das normal? Wenn ja, wie erstelle ich in einem fremden Programm einen neuen button in seiner toolbar?
Mario
MSN: cyanide@ccode.de
  Mit Zitat antworten Zitat
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#2

Re: ToolBar-Button einem anderen Fenster übergeben

  Alt 1. Jun 2004, 11:26
^^^^^^^^^^^^^^^^
Mario
MSN: cyanide@ccode.de
  Mit Zitat antworten Zitat
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#3

Re: ToolBar-Button einem anderen Fenster übergeben

  Alt 3. Jun 2004, 12:06
^^^^^^^^^^^^^^^^
Mario
MSN: cyanide@ccode.de
  Mit Zitat antworten Zitat
Benutzerbild von Luckie
Luckie

Registriert seit: 29. Mai 2002
37.621 Beiträge
 
Delphi 2006 Professional
 
#4

Re: ToolBar-Button einem anderen Fenster übergeben

  Alt 3. Jun 2004, 12:15
Hol dir das Handle der Fremden Toolbar und erzeuge den Button dort direkt.

Aber was willst du dort mit einem Button? Wie willst du Code ausführen, wenn dort draufgeklickt wird? Benachrichtigt wird nur die fremde Anwendung bei einem Klick auf dem Button. Und dann?
Michael
Ein Teil meines Codes würde euch verunsichern.
  Mit Zitat antworten Zitat
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#5

Re: ToolBar-Button einem anderen Fenster übergeben

  Alt 3. Jun 2004, 13:53
hallo luckie,

daran habe ich auch schon gedacht, aber erstens wusste ich nicht wie ich einen neuen button per api erstelle und zeweitens wie du schon sagtest wie ich da code ausführe :\.

ich hatte es eigentlich so vor(es geht um mirc):

mirc ruft die dll per /dll auf -> die dll erstellt den button in der toolbar(den code den der button ausführen soll kennt sie ja denn).

aber ich kann SetParent nicht benutzen weil ein toolbutton kein handle hat, wieso ist das so?
Mario
MSN: cyanide@ccode.de
  Mit Zitat antworten Zitat
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#6

Re: ToolBar-Button einem anderen Fenster übergeben

  Alt 9. Jun 2004, 16:12
^^^^^^^^^
Mario
MSN: cyanide@ccode.de
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#7

Re: ToolBar-Button einem anderen Fenster übergeben

  Alt 9. Jun 2004, 16:22
Ich kenne die Schnittstellen von Mirc nicht, aber wenn das, was Du willst überhaupt erfolgreich geht, dann muß Mirc dafür eine Schnittstelle bieten. Hast Du einen Link zu einer Seite die etwas zu dem Paramter /dll schreibt?

Wenn Mirc das Gewünschte nicht von sich aus bietet, dann wird es Dir nicht möglich sein dieses einzubinden

......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
Benutzerbild von Pseudemys Nelsoni
Pseudemys Nelsoni

Registriert seit: 24. Dez 2002
Ort: Hamburg-Harburg
3.551 Beiträge
 
#8

Re: ToolBar-Button einem anderen Fenster übergeben

  Alt 9. Jun 2004, 16:46
hallo sakura,

ich habe vor eine progressbar etc in mirc zu benutzen, es gibt viele scripts die genau das machen was ich vor habe, z.b:

http://www.nnscript.de/

btw: ich quote mal die mirc hilfe:

Zitat:
DLL Support

The /dll and $dll() features allow you to make calls to DLLs designed to work with mIRC. The main reason you'd want to do this is that processing information in a DLL can be far faster than doing so in a script, so for intensive data processing a DLL would be more efficient.

Note that mIRC also supports calling COM objects, for calling non-standard DLLs.

Warning: do not use DLLs from sources you do not trust. See the Accepting Files section for information on the dangers of accepting and using files from the internet.

/dll <filename> <procname> [data]
$dll(filename, procname, data)

$dllcall(filename, alias, procname, data)


The above open a DLL, call the procname routine, and send it the specified data. The only difference is that $dll() can return a value, like all other identifiers.

$dllcall() is multi-threaded so it will not halt the script and will call the specified alias once the call returns.

Technical notes
This section contains technical information for programmers who want to create DLLs for use with mIRC.

The routine in the DLL being called must be of the form:

int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)

mWnd is the handle to the main mIRC window.

aWnd is the handle of the window in which the command is being issued, this might not be the currently active window if the command is being called by a remote script.

data is the information that you wish to send to the DLL. On return, the DLL can fill this variable with the command it wants mIRC to perform if any.

parms is filled by the DLL on return with parameters that it wants mIRC to use when performing the command that it returns in the data variable.

Note: The data and parms variables can each hold 900 chars maximum.

show is FALSE if the . prefix was specified to make the command quiet, or TRUE otherwise.

nopause is TRUE if mIRC is in a critical routine and the DLL must not do anything that pauses processing in mIRC, eg. the DLL should not pop up a dialog.

The DLL can return an integer to indicate what it wants mIRC to do:

0 means that mIRC should /halt processing

1 means that mIRC should continue processing

2 means that it has filled the data variable with a command which it wants mIRC to perform, and has filled parms with the parameters to use, if any, when performing the command.

3 means that the DLL has filled the data variable with the result that $dll() as an identifier should return.

Note: You may need to create a .def file with the procedure names exported when compiling your DLL.

Keeping a DLL Loaded after a call
By default a DLL is unloaded immediately after you make the /dll or $dll() call. You can keep a DLL loaded by including a LoadDll() routine in your DLL, which mIRC calls the first time you load the DLL:

void __stdcall (*LoadDll)(LOADINFO*);

typedef struct {
DWORD mVersion;
HWND mHwnd;
BOOL mKeep;
} LOADINFO;

mVersion contains the mIRC version number in the low and high words.

mHwnd contains the window handle to the main mIRC window.

mKeep is set to TRUE by default, indicating that mIRC will keep the DLL loaded after the call. You can set mKeep to FALSE to make mIRC unload the DLL after the call (which is how previous mIRCs worked).

Unloading a DLL
You can unload a loaded DLL by using the -u switch:

/dll -u <filename>

You can browse the list of loaded DLLs by using:

$dll(N/filename) returns the Nth loaded DLL

mIRC will automatically unload a DLL if it is not used for ten minutes, or when mIRC exits.

You can also define an UnloadDll() routine in your DLL which mIRC will call when unloading a DLL to allow it to clean up.

int __stdcall (*UnloadDll)(int mTimeout);

The mTimeout value can be:

0 UnloadDll() is being called due to a DLL being unloaded when mIRC exits, or unloaded with /dll -u.

1 UnloadDll() is being called due to a DLL not being used for ten minutes. The UnloadDll() routine can return 0 to keep the DLL loaded, or 1 to allow it to be unloaded.
also mirc kann schon mit dlls umgehen, ist nur die frage wie ich die dll erstelle die das kann was ich vorhabe, eben einen neuen button hinzufügen
Mario
MSN: cyanide@ccode.de
  Mit Zitat antworten Zitat
Benutzerbild von sakura
sakura

Registriert seit: 10. Jun 2002
Ort: München
11.412 Beiträge
 
Delphi 11 Alexandria
 
#9

Re: ToolBar-Button einem anderen Fenster übergeben

  Alt 9. Jun 2004, 16:51
Da steht nix groß drinne, womit ich was anfangen könnte. Aber Du kannst das MainWindow theoretisch nach Handles (z.B. der Progressbar) durchsuchen und deren Controls ändern.

Neue Buttons einfügen, welche dann Deine DLL aufrufen wird eindeutig nicht unterstützt.

......
Daniel W.
Ich bin nicht zurück, ich tue nur so
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:19 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz