Jump to content

mike9900

Members
  • Posts

    3
  • Joined

  • Last visited

mike9900's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Look at the Send Key List in the index. That will give you a list of all of the keys. {TAB} TAB
  2. Issue #1 Is the notepad window active when the code is ran? Try this If WinActivate("[CLASS:Notepad]") Then WinSetState("[CLASS:Notepad]", "", @SW_MINIMIZE) Sleep(1000) WinSetState("[CLASS:Notepad]", "", @SW_MAXIMIZE) EndIf Or put a sleep in before WinActive to give you some time to make the notepad window active.... Issue #2 You need to use WinGetState. Use something like this $value = WinGetState("[CLASS:Notepad]") if BitAnd($value, 32) then MsgBox(0,"WinSize","Notepad window is maximized") else MsgBox(0,"WinSize","Notepad window is not maximized") EndIf
  3. Sorry for the resurrection of an old post..... I'm no good at RegEx, and I wrote this to get around it using StringReplace. Hope this makes sense. Might not be the best looking piece of code, but it does what the OP asks. $string = "This is the text I want to keep|This is the text I want to delete" $findText = "|*" $replaceText = "" $newString = StringReplace($string,WildCardFindText($findText,$string),$replaceText) MsgBox(0,"New",$newString) Func WildCardFindText($findText, $string) If StringInStr($findText,"*") > 0 Then $WildCardPosition = StringInStr($findText,"*") If $WildCardPosition = StringLen($findText) Then $findText = StringLeft($findText,(StringLen($findText)-1)) $findText = StringRight($string,(StringLen($string)-StringInStr($string,$findText))+1) Else $findText = StringRight($findText,(StringLen($findText)-1)) $findText = StringLeft($string,(StringLen($string) - (StringLen($string)-StringInStr($string,$findText)))) EndIf EndIf Return $findText EndFunc
×
×
  • Create New...