Jump to content

delme

Active Members
  • Posts

    30
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

delme's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hey guys I'm having a lot of trouble trying to set a background picture for a listview control. I know it can be done in other languages such as VB (though I don't code in VB) but I can't find anywhere in the help docs that explain how to do it in au3? Is this possible in au3? Thanks
  2. Don't think it works with TCP connections. Also the IP would be, "192.168.1.255", he told me to leave out the "." because I had one extra..
  3. Hey, would you mind sharing the code for the dll? I can't get any of mine to display a message box or do anything once they are injected into a process.. I know this isn't a C++ forum but I thought you may be able to help This is the code I have.. main.h #ifndef __MAIN_H__ #define __MAIN_H__ #include <windows.h> /* To use this exported function of dll, include this header * in your project. */ #ifdef BUILD_DLL #define DLL_EXPORT __declspec(dllexport) #else #define DLL_EXPORT __declspec(dllimport) #endif #ifdef __cplusplus extern "C" { #endif void DLL_EXPORT SomeFunction(const LPCSTR sometext); #ifdef __cplusplus } #endif #endif // __MAIN_H__ main.cpp #include "main.h" // a sample exported function void DLL_EXPORT MessageBox(const LPCSTR sometext) { MessageBoxA(0, sometext, "DLL Message", MB_OK | MB_ICONINFORMATION); } BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { MessageBox("Testing"); switch (fdwReason) { case DLL_PROCESS_ATTACH: // attach to process // return FALSE to fail DLL load break; case DLL_PROCESS_DETACH: // detach from process break; case DLL_THREAD_ATTACH: // attach to thread break; case DLL_THREAD_DETACH: // detach from thread break; } return TRUE; // succesful } but it isn't displaying a message... Thanks for the UDF!
  4. Finished the update, just scrapped the old version and wrote a new one . The code is now 100 times better
  5. Currently updating this code so that it will be able to handle files of any size, and will be able to re-start an interrupted transfer from where it was left off.
  6. Thanks for all the replys guys, they are all very helpful
  7. Hey guys, I'm coding an irc bot that will have plugin funtionality, ie: it will call certain functions when events happen, it will work something like this: A message is recieved, bot checks for the command trigger, if the trigger is found it will call the function IRC_BOT_TRIGGERED($command) But there will be loads more functions that can be called. What I want to do is be able to see if the user has defined a function to be called when an event happens, say there are more events such as a ping being recieved etc, but I want to only call the function if the user has defined it in the plugin file, is this possible? To help a bit more, kind of like using #ifndef in C++, I want to be able to see if the function is defined before trying to call it, as it will meet an error if it isn't defined. Pretty much exactly how the Messenger Live Plus scripting plugins work. Any help or pointers to the right direction will be appreciated. Thanks DELmE
  8. Hey man, I made a simple LAN chat program a few days ago when I was bored of homework. I just searched for "LAN Broadcast" to get some more help on the topic as I am just starting to learn more about this method and I found this, you have inspired me! This program looks so cool, I'm on a Linux OS at the moment but when I get to a Windows box I am going to try this out . Thanks for all the obvious hard work you've put into this man! Just one question, what is the best way to calculate the broadcasting address of a network? If my local IP is something like 192.168.1.64 will the broadcast address always be 192.168.1.255? Thanks again for sharing this program
  9. Hey thanks, that's fixed it, I'll update the code, I guess I should have checked that aye?
  10. Hey, thanks for the advice, I didn't even know there was a broadcast ability, that's cool. Ill update the code Edit: Hmm.. with the broadcast method it doesn't seem to be working, does this method also send the data to the computer that has sent it out?
  11. Hey guys, I havn't been coding in Autoit much lately, except when I just recently made the client for my C++ chat server in Autoit. But I needed a bit of a distraction from my homework so I whipped this up in a few mins and thought I'd share it as it may be interesting for some people. It isn't very well developed as I was just playing around with it to see how fast the chat would run but hey, I think it could be pretty cool. If something like this has been posted before (and I'm 100% sure there has) I apologize So this is a chat program that works without a server by scanning all the IP addresses on the LAN (Local Area Network - so it will not work over the internet) and sending the messages when it makes a connection. This would be good for school and such as most schools usually have a LAN set up between their computers, or one LAN per computer lab etc. I also didn't use TCP, I used UDP instead as it seemed better for the job to me as it is making a lot of fast connections and this way it wouldn't have to go through the TCP handshake. So anyway, heres the code: #cs ---------------------------------------------------------------------------- DELmE's LanChat #ce ---------------------------------------------------------------------------- ;include files #include <GuiConstants.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> #include <GuiEdit.au3> ;define variables Global $hGui, $hEdit, $hInp, $hBtn, $username, $rsock, $ssock, $recv Global $port = 7892 Global $Broadcast = StringLeft(@IPAddress1, StringInStr(@IPAddress1, ".", 0, 3)) & "255" ;start main function _main() Func _main() ;get username $username = InputBox("LanChat","Please enter your username.") If $username = "" Then MsgBox(16,"Error","A username must be entered.") Exit EndIf ;create gui $hGui = GUICreate("LanChat",500,500) $hEdit = GUICtrlCreateEdit("Welcome to DELmE's LanChat",0,0,500,480,BitOR($ES_READONLY,$ES_WANTRETURN,$WS_VSCROLL,$ES_AUTOVSCROLL)) _GUICtrlEdit_SetLimitText($hEdit,99999999999999) $hInp = GUICtrlCreateInput("",0,480,470,20) $hBtn = GUICtrlCreateButton("Send",470,480,30,20,$BS_DEFPUSHBUTTON) ;display gui GUISetState() ;start winsock for udp UDPStartup() ;bind a socket to the port for listening $rsock = UDPBind(@IpAddress1,$port) If @error <> 0 Then Exit ;send message informing of online status SendMsg("-"&$username&" has come online.") ;start gui loop Do $recv = UDPRecv($rsock,1024) If $recv <> "" Then Print($recv) EndIf $msg = GUIGetMsg() If $msg = $hBtn Then $buffer = GUICtrlRead($hInp) If $buffer <> "" Then GUICtrlSetData($hInp,"") SendMsg("<"&$username&">: "&$buffer) EndIf EndIf Until $msg = $GUI_EVENT_CLOSE Exit EndFunc ;==> _main Func SendMsg($txtMsg) $ssock = UDPOpen($Broadcast,$port) If @error = 0 Then UDPSend($ssock,$txtMsg) EndIf UDPCloseSocket($ssock) EndFunc ;==> SendMsg Func Print($txtMsg) _GUICtrlEdit_AppendText($hEdit,@CRLF&$txtMsg) EndFunc ;==> Print Func OnAutoItExit() ;send message informing of offline status SendMsg("-"&$username&" has gone offline.") UDPShutdown() EndFunc ;==> OnAutoItExit Hope you guys find this usefull, I think it could be made into a cool little application with the right improvements Post your comments, I'll try to check this post but I do have a lot of homework... Thanks DELmE Change Log: 10/03/10 - Updated code to use the broadcast method that Apzo suggested also added an attachment with the code 11/03/10 - Fixed an error with the broadcast ipLanChat_1.1.au3
  12. Hmm. I dunno what that is. Never happened to me. Do you have any other programs open that are using TCP or UDP? Edit: I'm thinking that it may be because while the file is being sent the data is stored in a variable and maybe 19MB of data passes the length that AutoIt can carry in a variable, just taking a stab though as I don't really know..
×
×
  • Create New...