Jump to content



Photo

Hide _GUICtrlIpAddress_Create


  • Please log in to reply
13 replies to this topic

#1 marcsusy

marcsusy

    Seeker

  • Active Members
  • 29 posts

Posted 24 April 2012 - 06:46 PM

Hello Good afternoon:

Sorry for my bad ingles.Me like to explain to me how I can disable only the fourth byte or octet of an IP address created with the function _GUICtrlIpAddress_Create

Greetings and thanks





#2 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,315 posts

Posted 24 April 2012 - 07:26 PM

Look here at MSDN reference for IPAdress control
http://msdn.microsoft.com/en-us/library/windows/desktop/ff485953(v=vs.85).aspx

As I see I think you can handle IPN_FIELDCHANGED notification to reset actually changed value to some other.
http://msdn.microsoft.com/en-us/library/windows/desktop/ff485956%28v=vs.85%29.aspx

EDIT: fixed broken link

Edited by Zedna, 25 April 2012 - 11:53 AM.


#3 marcsusy

marcsusy

    Seeker

  • Active Members
  • 29 posts

Posted 25 April 2012 - 06:05 AM

Hello Zedna

I have not explained well, I need to do a search on a database with only the first three fields of an IP address for that reason I need to enter fields that have enabled only the top three in _GUICtrlIpAddress_Create function.

thanks


#4 marcsusy

marcsusy

    Seeker

  • Active Members
  • 29 posts

Posted 25 April 2012 - 11:06 AM

Who could help me, I have to search a database with only the first three fields of an IP address as the last field of the window created by the function _GUICtrlIpAddress_Create not need it, my question is how I can disable it so that only can type the first three bytes.

thanks

#5 guinness

guinness

    guinness

  • MVPs
  • 10,245 posts

Posted 25 April 2012 - 11:18 AM

Read the IP address field and then use a SRE like this >>

Local $sIPAddress = '120.100.20.20' ; Read the IP address field. ConsoleWrite(StringRegExpReplace($sIPAddress, '(d{1,3}.d{1,3}.d{1,3}).d{1,3}', '1') & @CRLF)

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#6 marcsusy

marcsusy

    Seeker

  • Active Members
  • 29 posts

Posted 25 April 2012 - 11:43 AM

What I need is that the function has the last field _GUICtrlIpAddress_Create disabled

thanks


#7 guinness

guinness

    guinness

  • MVPs
  • 10,245 posts

Posted 25 April 2012 - 11:51 AM

Did you try what Zedna provided? Otherwise if you don't know how then look at another way.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#8 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,315 posts

Posted 25 April 2012 - 11:52 AM

I think simple way for doing it by API doesn't exist.
Just create three edit boxes and labels with dot between them.

#9 rover

rover

    unmutual

  • Active Members
  • PipPipPipPipPipPip
  • 825 posts

Posted 25 April 2012 - 02:14 PM

Those Edit controls are children of SysIPAddress32, just as SysHeader32 is a child of SysListView32

#include <GUIConstantsEx.au3> #include <GuiIPAddress.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Global $hIPAddress _Main() Func _Main()     Local $hgui, $hIPAddress     $hgui = GUICreate("IP Address Control Create Example", 400, 300)     $hIPAddress = _GUICtrlIpAddress_Create($hgui, 10, 10)     GUISetState(@SW_SHOW)     _GUICtrlIpAddress_Set($hIPAddress, "24.168.2.128") ControlDisable($hIPAddress, "", "[CLASSNN:Edit1]")     Do     Until GUIGetMsg() = $GUI_EVENT_CLOSE _GUICtrlIpAddress_Destroy($hIPAddress) Exit EndFunc

I see fascists...

#10 guinness

guinness

    guinness

  • MVPs
  • 10,245 posts

Posted 25 April 2012 - 02:24 PM

Those Edit controls are children of SysIPAddress32, just as SysHeader32 is a child of SysListView32

#include <GUIConstantsEx.au3> #include <GuiIPAddress.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Global $hIPAddress _Main() Func _Main()     Local $hgui, $hIPAddress     $hgui = GUICreate("IP Address Control Create Example", 400, 300)     $hIPAddress = _GUICtrlIpAddress_Create($hgui, 10, 10)     GUISetState(@SW_SHOW)     _GUICtrlIpAddress_Set($hIPAddress, "24.168.2.128") ControlDisable($hIPAddress, "", "[CLASSNN:Edit1]")     Do     Until GUIGetMsg() = $GUI_EVENT_CLOSE _GUICtrlIpAddress_Destroy($hIPAddress) Exit EndFunc

Learnt something new today.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#11 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,315 posts

Posted 25 April 2012 - 02:35 PM

Those Edit controls are children of SysIPAddress32, just as SysHeader32 is a child of SysListView32
...


Great!! ;)

#12 guinness

guinness

    guinness

  • MVPs
  • 10,245 posts

Posted 25 April 2012 - 03:02 PM

Sorry Rover >> http://www.autoitscript.com/forum/topic/139260-autoit-snippets/page__view__findpost__p__982237

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUISetIcon()_Icon_Clear()/_Icon_Set()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringIsValid()_StringReplaceWholeWord()_StringStripChar()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()AutoIt SearchAutoIt3 PortableAutoItWinGetTitle()/AutoItWinSetTitle()CodingFileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIGetBkColor()LockFile()PasteBinSciTE JumpSignature CreatorWM_COPYDATAMore Examples...Updated: 11/04/2013


#13 marcsusy

marcsusy

    Seeker

  • Active Members
  • 29 posts

Posted 27 April 2012 - 08:01 PM

rover through the solution you gave me works perfectly

#14 rover

rover

    unmutual

  • Active Members
  • PipPipPipPipPipPip
  • 825 posts

Posted 29 April 2012 - 08:37 PM

Sorry Rover >> http://www.autoitscript.com/forum/topic/...snippets/page__view__findpost_


Sorry for what?
I see fascists...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users